jimfog Posted September 14, 2011 Share Posted September 14, 2011 here http://michaeljacobdavis.com/tutorials/statesavingaccordion/statesavingaccordion.html#2, you will find a demo of an accordion menu. Obviously, most of you know that already. The reason i set out this example is the following: In this menu if you choose First Menu Item you get First menuItem text. The same analogy applies if you choose the other menu item. What i want is that regardless of the menu item chosen i want the same text appearing. For example, either the user clicks the First Menu Item or the Second Menu Item the same text appears. It would be tedious and impractical to write the same code again and again. So, how am i going to achieve the above? Do i have to write a function and call it upon clicking at each menu item? Is there any other way you have to propose? Link to comment Share on other sites More sharing options...
Ingolme Posted September 14, 2011 Share Posted September 14, 2011 You want the two menus to be identical? Since this relies on HTML structure, you're going to have to copy the HTML. If you want to make sure that when you change one, the other one changes, then use PHP to print the same variable in both places. Link to comment Share on other sites More sharing options...
dsonesuk Posted September 14, 2011 Share Posted September 14, 2011 Look into jquery cloning might be worth looking into me thinks. Link to comment Share on other sites More sharing options...
jimfog Posted September 17, 2011 Author Share Posted September 17, 2011 In the end, I just passed the code in a variable and called it repeatedly(at each menu item) using an echo statement. That solved the issue. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.