// Toggle the close button to a menu button.
$(this).css('background', 'url(' + media_base_url + 'assets/menu.png) 0 0 no-repeat');
// Show the menu.
- $('#mobilenav').css("display", "none");
+ //$('#mobilenav').css("display", "none");
}
menuCounter++;
});
});
}
+function setNav() {
+ /* Close all. */
+ $('#mobilenav ul ul').addClass('closed');
+
+ /* Find the current anchor. */
+ var currentAnchor = $('#mobilenav ul').find('.current').eq(0);
+ /* Open all the current anchor's parents. */
+ currentAnchor.parents('ul').removeClass('closed');
+ currentAnchor.parents('ul').addClass('open');
+ /* Open the current anchor's children. */
+ if(currentAnchor.siblings('ul').length > 0) {
+ currentAnchor.siblings('ul').eq(0).removeClass('closed');
+ currentAnchor.siblings('ul').eq(0).addClass('open');
+ }
+}
+
$(function(){
setMobileNav();
+ setNav();
})
\ No newline at end of file
<script src="{mediaBaseURL:h}libjs/foundation/foundation.topbar.js"></script>
{bottomScripts:h}
<script>
-$(document).foundation();
+$(document).foundation({
+ offcanvas: {
+ open_method: 'move',
+ close_on_click: false
+ }
+});
</script>
</body>
</html>