jquery - Get the ids of the menu items in the level 1 panel -
currently using openpanel open right panel depending on page's url.
switch ( this.filenameurl ) { case 'page1.html' : this.api.openpanel( $("#mm-1") ); break; case 'page2.html' : this.api.openpanel( $("#mm-12") ); break; case 'page3.html' : this.api.openpanel( $("#mm-71") ); break; case 'page4.html' : this.api.openpanel( $("#mm-137") ); break; case 'page5.html' : this.api.openpanel( $("#mm-146") ); break; } this.api.open();
it works fine. challenge if page added or removed or moved #mm-## change.
is there better way more dynamic?
Comments
Post a Comment