KTOffcanvas
is a Metronic's custom plugin defined in [metronic]/theme/html/[demo]/src/js/components/base/offcanvas.js
.
KTOffcanvas
is a Metronic's custom plugin defined in [metronic]/theme/html/[demo]/src/js/components/base/offcanvas.js
.
First parameter is the id, class, or tag of the HTML element. The second parameter is for the options.
_offcanvasObject = new KTOffcanvas(_element, {
baseClass: offcanvasClass,
overlay: true,
closeBy: 'kt_aside_close_btn',
toggleBy: {
target: 'kt_aside_mobile_toggle',
state: 'mobile-toggle-active'
}
});
var options = {
baseClass: offcanvasClass,
overlay: true,
closeBy: 'kt_aside_close_btn',
toggleBy: {
target: 'kt_aside_mobile_toggle',
state: 'mobile-toggle-active'
}
}
Field | Type | Description | ||
---|---|---|---|---|
overlay |
boolean |
Enable/disable offcanvas overlay
|
||
baseClass |
string |
Set the base class for the offcanvas
|
||
closeBy |
string |
Define the element for the off canvas to be closed when this element is clicked
|
||
toggleBy |
object |
Define which element for the toggle and set the active state class name
|
Method | Description |
---|---|
setDefaults(options) |
Set default options @param options |
isShown() |
Check if canvas is shown @returns {boolean} |
hide() |
Set to hide the canvas |
show() |
Set to show the canvas |
on(name, handler) |
Attach event @param name @param handler |
one(name, handler) |
Attach event that will be fired once @param name @param handler |