Skip to content

Multiple Trigger Buttons

Vasileios Mitsaras edited this page May 2, 2019 · 1 revision

Method A

<button data-offcanvas-trigger="left">js-trigger-offcanvas</button>
<button data-offcanvas-trigger="left">js-trigger-offcanvas</button>

<aside class="js-offcanvas" data-offcanvas-options='{"modifiers":"left, overlay"}'  id="left">
...
</aside>
$( document ).trigger( "enhance" );

Method B

<button class="js-btns">js-trigger-offcanvas</button>
<button class="js-btns">js-trigger-offcanvas</button>

<aside id="left">...</aside>
$( '.js-btns' ).offcanvasTrigger( {
  offcanvas: "left"
});
$( document ).trigger( "enhance" );

Issue: Support for multiple trigger buttons #42

Clone this wiki locally