-
Notifications
You must be signed in to change notification settings - Fork 30
01 Getting Started
Vasileios Mitsaras edited this page May 2, 2019
·
2 revisions
- Install with npm:
npm install js-offcanvas - Install with yarn:
yarn add js-offcanvas
Include the .css and .js files in your site.
<script src="js-offcanvas.pkgd.min.js"></script>
<link href="js-offcanvas.css" rel="stylesheet"> <div class="c-offcanvas-content-wrap">
<a href="#offCanvas" id="triggerButton">Menu</a>
<!-- Your Main Content goes here -->
</div>
<aside id="offCanvas"></aside>$('#offCanvas').offcanvas({
modifiers: 'left, overlay', // default options
triggerButton: '#triggerButton' // btn to open offcanvas
});<a class="js-offcanvas-trigger"
data-offcanvas-trigger="off-canvas-id"
href="#off-canvas">Menu</a>
<aside class="js-offcanvas"
data-offcanvas-options='{"modifiers": "left,overlay"}'
id="off-canvas-id">...</aside> // Trigger Enhance
$( function(){
$(document).trigger("enhance");
});