Documentation v8.0.25

Preview Purchase

Overview

Smooth Scrollis a lightweight script to animate scrolling to anchor links. For more info please visit the plugin's site.

Usage

Smooth Scroll's Javascript files are bundled in the global scripts bundles and are globally included in all pages:
<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css"/>
<script src="assets/js/scripts.bundle.js"></script>

Initialization

  • Smooth Scroll's Javascript is globally initialized with our KTAppwrapper defined in src/js/layout/app.js.
  • To include Smooth Scroll into your project, you need to include a HTML attribute data-kt-scroll-togglewithin the aelement with a hrefset with a hastag #. For more options available, such as offsetparameters, please refer to the initialization definition in src/js/layout/app.js.
  • For more information on Smooth Scroll's other options, please refer to the official plugin site.

Basic Example

Click on the button below to scroll to the top without any offset.
<a href="#top" class="btn btn-primary" data-kt-scroll-toggle>Scroll to Top</a>

<div id="top">
    ...
</div>

Offset Example

Click on the button below to scroll to "Usage" with offset. Add the HTML attribute data-kt-scroll-offsetwith the offset value in pxto the anchor element.
<a href="#usage" class="btn btn-primary" data-kt-scroll-toggle>Scroll to Usage</a>

<div id="usage" data-kt-scroll-offset="85">
    ...
</div>

Responsive Offset Example

Click on the button below to scroll to "Initialization" with a responsive offset. Add the HTML attribute data-kt-scroll-offsetwith the offset value in pxto the anchor element. The responsive values follows the standard Bootstrap breakpoints where defaultrepresents the base size and moves up with sm, md, lgor xl.
<a href="#initialization" class="btn btn-primary" data-kt-scroll-toggle>Scroll to Usage</a>

<div id="initialization" data-kt-scroll-offset="{default: 75, lg: 85}">
    ...
</div>

Explore Metronic

Demo1

Demo2

Demo3

Demo4

Demo5

Demo6

Demo7

Demo8

Demo9

Demo10

demo
Coming soon

Demo11

Demo12

demo
Coming soon

Demo13

Demo14

demo
Coming soon

Demo15

demo
Coming soon

Demo16

demo
Coming soon

Demo17

demo
Coming soon

Demo18

demo
Coming soon

Demo19

demo
Coming soon

Demo20

demo
Coming soon