3

Hi i have the following code

 var $tabs = $("#tabs").tabs({
      cookie: { expires:1 }
  });

this very nice. But how can i unset this cookie? something like

$( "#tabs" ).tabs( "option", "cookie", { expires: 0 } );

Any suggestion?

4

2 に答える 2

4

You can set the name of the cookie in the parameters.

Since jQuery UI 1.7 it is also possible to define the cookie name being used via name property.

Name your cookie this way :

var $tabs = $("#tabs").tabs({
    cookie: { expires:1, name: "tab_cookie" }
});

Since jQuery uses jquery.plugin.cookie.js for this to work, you can use this same plugin to erase your cookie :

$.cookie('tab_cookie', null);
于 2011-05-10T12:41:30.383 に答える
1

The jQuery UI tabs cookie option has an additional name parameter which lets you specifically define the name of the cookie, as opposed to letting jQuery UI define the name. If you do this, then you can control the cookie with the jQuery Cookie plugin to delete it.

var $tabs = $("#tabs").tabs({
     cookie: { expires:1, name: "tabcookie" }
});
$.cookie('tabcookie', null);
于 2011-05-10T12:42:44.280 に答える