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

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -