Closed daveromsey closed 5 years ago
Hi David,
the triggerButton is optional. Check the Demo without triggerButton. Now for your Problem. Can you try this:
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" );
or 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" );
Can you tell me what works for you?
Thank you for such a quick and helpful response. I went with option B and it works great.
I would like to use multiple trigger buttons for my JS Offcanvas menu, but it seems that the options limit the
triggerButton
selector to the first element only:I'd like for all elements matching the selector used for
options.triggerButton
to work.Edit: I was able to create a workaround, but I do believe that the expected behavior of using a selector that allows class names is to apply the functionality to all instances found.