Hi All,
I have used this code for UI tabs.
http://jqueryui.com/demos/tabs/
I tried to get back the last visited tabs after page refresh using cookies. But I failed to set cookies here.
Any thoughts on this?
Thanks
settings jquery tabs cookies
Moderator: General Moderators
- lord_webby
- Forum Commoner
- Posts: 44
- Joined: Wed Aug 19, 2009 9:01 am
Re: settings jquery tabs cookies
http://jqueryui.com/demos/tabs/#event-enable
Modify the click event to store the currently selected tab - then use the click function using the windows onload property to enable the tab you want
Modify the click event to store the currently selected tab - then use the click function using the windows onload property to enable the tab you want
Code: Select all
var $tabs = $('#example').tabs(); // first tab selected
$('#my-text-link').click(function() { // bind click event to link
$tabs.tabs('select', 2); // switch to third tab
return false;
});Re: settings jquery tabs cookies
Thanks for your reply.
But I solved it by writing this line of code:
Thanks again.
But I solved it by writing this line of code:
Code: Select all
$('#tabs').tabs({ cookie: { expires: 30 } });