-
Notifications
You must be signed in to change notification settings - Fork 30
02 Options
Vasileios Mitsaras edited this page May 2, 2019
·
1 revision
Set instance options by passing a valid object at initialization, or to the public defaults method. Custom options for a specific instance can also be set by attaching a data-offcanvas-options attribute to the target elment. This attribute should contain the properly formatted JSON object representing the custom options.
data-offcanvas-options='{ "modifiers": "left,overlay",... }'
Name | Default | Type |
---|---|---|
modifiers | "left,overlay" | string |
baseClass | "c-offcanvas" | string |
modalClass | "c-offcanvas-bg" | string |
contentClass | "c-offcanvas-content-wrap" | string |
closeButtonClass | "js-offcanvas-close" | string |
role | "dialog" | string |
bodyModifierClass | "has-offcanvas" | string |
supportNoTransitionsClass | "support-no-transitions" | string |
resize | false | boolean |
triggerButton | null | string |
onInit | null | function |
onOpen | null | function |
onClose | null | function |
$('#offCanvas').offcanvas({
role: "dialog",
modifiers: "left,overlay",
baseClass: "c-offcanvas",
modalClass: "c-offcanvas-bg",
contentClass: "c-offcanvas-content-wrap",
closeButtonClass: "js-offcanvas-close",
bodyModifierClass: "has-offcanvas",
supportNoTransitionsClass: "support-no-transitions",
resize: false,
triggerButton: '#triggerButton' ,
modal: true,
onOpen: function() {},
onClose: function() {},
onInit: function() {}
});