I recently made some updates to a project using Foundation 5.3, but I'm struggling to get the Off Canvas feature to work properly. I've attempted different versions of jQuery (1.x - 2.x) without success.
To troubleshoot, I created a simple jsfiddle page with the necessary code:
<div class="off-canvas-wrap" data-off-canvas>
<div class="inner-wrap">
<aside class="right-off-canvas-menu">
<h1>Hello</h1>
</aside>
<a href="#" class="right-off-canvas-toggle">Menu</a>
</div>
</div>
<script type="text/javascript">
$(document).foundation();
</script>
I'm unsure if I'm missing something or if there might be a bug in the code somewhere?
Interestingly, manually adding the class move-left
to the menu triggers the CSS transition correctly, indicating a possible issue with how the toggle is being bound.
Upon loading, no errors are shown in the console.
When attempting to programmatically call
$('.off-canvas-wrap').foundation('offcanvas', 'open', 'move-left');
, I receive an error: "TypeError: this[method] is undefined"