- This topic is empty.
December 17, 2011 at 5:09 am #35691
Here is the code:
I am using the tabs to fire GET requests to the server so that the PHP scripts there assemble each time new pages. Of course, each page includes the menu with my tabs, which needs to have the rending persistance as per the user’s choice (it’s about color change on click). The ‘li’ element’s selection, to be styled according to the CSS file, is identified by the “class=’active’” attribute, as above.
I am looking for a handy and elegant solution to adapt the above code so that to be able to send my GET request to the server when clicking on the tab, while keeping the scope of the article regarding the styling construction.
Unfortunately, because of my superficial knowledge of the jQuery library I can find ways to do the scope but that would seriously change the spirit of Chris solution.
Thanks for any hint.December 17, 2011 at 11:21 am #92959
I’ve solved it by getting rid of the preventDefault method and by saving, on click, the selection id through session storage + executing the above code (minus the e.preventDefault()) in the document.ready of the page.December 17, 2011 at 12:21 pm #92964jamygoldenMember
preventDefault() isn’t necessary on a list item.December 17, 2011 at 2:13 pm #93000
@jamy_za. Yes thanks, I wonder why the method was put there, that misled me. Is nice your code shortcut.