Question

I am using jquery UI 1.10 and I need to enable cookie in tabs. It used to work before.

But despite getting lokely lates jquery cookies 1.31 (https://github.com/carhartl/jquery-cookie/blob/master/jquery.cookie.js) my tabs do not record a correct cookie. It does not change when I switch tabs.

Tabs are initialized as:

     $("#tabs").tabs({ cookie: { expires: 30, name: "userprivtabs"} });

Is there any way to make it work?

Thank you in advance!

Was it helpful?

Solution

This Worked for me

$("#tabs").tabs({
    activate: function (e, ui) { 
        $.cookie('selected-tab', ui.newTab.index(), { path: '/' }); 
    }, 
    active: $.cookie('selected-tab')
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top