php - Multi-level push menu state from page to page -
i'm attempting use multi-level push menu found here:
http://tympanus.net/codrops/2013/08/13/multi-level-push-menu/
the source available there well. i've adapted source work way want. have pieces in php includes there minimal reloading of portions when go page page.
the 1 part can't stick actual menu on left hand side. when click on link, menu disappears/completely collapses. know how can adapt menu state saved when navigating page page?
thanks!
it's suggested on blog change 'this.open' 'true' within '_init' method.
_init : function() { ... this.open = true; however didn't work me!
invoking '_openmenu()' method @ initialization time, right after 'this._init()' expand menu potentially bring problems event listener body click...
function mlpushmenu( el, trigger, options ) { this.el = el; this.trigger = trigger; this.options = extend( this.defaults, options ); // support 3d transforms this.support = modernizr.csstransforms3d; if( this.support ) { this._init(); this._openmenu(); // added } } second possibility:
if want "save" exact menu position, perhaps use following jquery multi-level push menu plug-in, , before leaving page, determine current menu state:
var $activemenu = $( '#menu' ).multilevelpushmenu( 'activemenu' );
thereafter can post whatever data (e.g. 'id')
var menuid = $activemenu.attr( 'id' );
to next page , use in there find , expand same menu level again using 'expand' method.
$( '#menu' ).multilevelpushmenu( 'expand', $( '#' + menuid ) );
Comments
Post a Comment