I am using jQuery tabs with the collapsible option. I was wondering how to save the state of my collapsible option (maximized or minimized) across subsequent requests(page loads), within a cookie. The ideas is if I refresh the page and the tab was minimized then i should see it minimized.
you can use the cookie
option built right into the plugin, Initialize a tabs with the cookie option specified.
$( ".selector" ).tabs({ cookie: { expires: 30 } });
Get or set the cookie option, after init.
//getter
var cookie = $( ".selector" ).tabs( "option", "cookie" );
//setter
$( ".selector" ).tabs( "option", "cookie", { expires: 30 } );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With