Keep the last selected tab 'selected' for subsequent page loads -- need help converting this working code into a plugin
Posted: Nov 11, 2009
I have this code working --http://www.pastie.org/692856 -- You can copy and paste it into an empty html page and presto it will work.
It sets a cookie (using the jquery cookie plugin) -- and when a user returns to the page, it will set the index of the tabs to what ever tab was previously selected.
I now want to improve this code by converting it into a plugin.
Ideally, I'd like to be able to chain the function when I initialized the tabs, like this:
Or something similar.
Can anyone offer some tips on getting started with the conversion?
Thanks,
Rich
It sets a cookie (using the jquery cookie plugin) -- and when a user returns to the page, it will set the index of the tabs to what ever tab was previously selected.
I now want to improve this code by converting it into a plugin.
Ideally, I'd like to be able to chain the function when I initialized the tabs, like this:
$("ul.tabs").tabs("div.panes > div").rememberTabSelected()
Or something similar.
Can anyone offer some tips on getting started with the conversion?
Thanks,
Rich