I have two menus: the Accordion menu and Tab menu, for the Tab menu, there is an assigned class selected to a link that is opened, I want to assign the class (for example) open_menu, in the same way for the accordion menu. actually if the class open_menu will be given from the condiotion that in its ul there is an A link with class Selected, it would be much better, because the class selected given to a link is taken from the cookies, and even if the page is refreshed it comes to this link Selected. Anyway, u can see all the source here: http://jsfiddle.net/bq6tA/6/
actually the end product i want, after the refresh of the page, there will be opened the accordion’s tab, as well as the Tab’s menu link selected that is in this accordion’s tab
I have two menus: the Accordion menu and Tab menu, for the Tab menu,
Share
See a working demo of the following code here.
I’ve modified your
initMenufunction to add theopen_menuclass to the appropriate accordion (and added a CSS class to indicate that it was added by changing the background to green):I then created a function to be called after
initMenuthat will trigger a click on the accordion with the samerelas theidof the currently selected item:To figure out what’s going on here, see the API docs for
closest,parentandchildrenand relate that to your HTML structure.