Keen - The Ultimate Multi-Demo Bootstrap Admin Theme

The most complete UI/UX template solution for today's web projects of any size

Keen Scrolltop

Overview

KTScrolltop is a Keen's custom plugin defined in [root]/theme/default/src/assets/js/theme/core/base/scrolltop.js.

Initialization

First parameter is the id, class, or tag of the HTML element. The second parameter is for the options.

var scrollTop = new KTScrolltop(id, options);
var scrollTop = new KTScrolltop('kt_scrolltop', {
    offset: 300,
    speed: 600,
    toggleClass: 'kt-scrolltop--on'
});

Options

var options = {
    offset: 300,
    speed: 600,
    toggleClass: 'kt-scrolltop--on'
};
Field Type Description
offset number

Bottom offset for the scroll top button icon

Sample
offset: 300
speed number

Speed of scroll to the top page

Sample
speed: 600
toggleClass number

Set the toggle class to body tag when the KTScrolltop is scrolling.

Sample
toggleClass: 'kt-scrolltop--on'

API Methods

Method Description
setDefaults(options)

Set default options

Input Parameters
Name Type Description
options object

A new options object for the menu

on(name, handler)

Register event

Input Parameters
Name Type Description
name string

Unique event name

handler function

Callback function handler for the event

one(name, handler)

Register event to be run once

Input Parameters
Name Type Description
name string

Unique event name

handler function

Callback function handler for the event