I am using the idtabs script from http://www.sunsean.com/idTabs/ and so far they work awesome. However, I am looking for a way to make it so that when the page reloads, the same tab that was selected is still open. So far i'm thinking there must be a way to set the .selected class to assign the default tab. I'm a huge js rookie so any ideas would be greatly appreciated.
Asked
Active
Viewed 808 times
2 Answers
1
You probably need to setup some kind of state persistence in your page so when you refresh the page, the tab you are currently on is not lost.
You could try using cookies like in this example :
http://jqueryui.com/demos/tabs/#cookie
You could also look at this SO post for anotherway to accomplish what you want :
Selecting a jQuery Tab using a parameter in the URL
I suggest you use a library like JQueryUI instead of the first one you come by googling. JQueryUI has more chance to last the test of time.
Good luck.
-
Thanks. My next move was going to be moving to ui. – Colin Morgan Jun 15 '10 at 16:25
-
well I actually went from jqueryui to idtabs because idtabs is more flexible and allows any html markup. Although I am struggling right now to make it work to set the active tab after postback. – Kat Lim Ruiz Dec 03 '13 at 17:00
-
jQueryUI is heavy, especially for just one feature. – Ben Racicot Sep 14 '15 at 22:09
0
If you want the page to reload then it doesn't make sense using tabs because you obviously know the action based on which can set the class.

piyer
- 746
- 4
- 11
-
it's pagination in WordPress. Whenever the page is changed it loads but it reverts to the default tab. – Colin Morgan Jun 15 '10 at 16:21