SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using cookie with jQuery UI Tabs

    I need to specify the cookie option after initialization of jQuery UI tabs. Though the cookie appears to be set, the tabs script is ignoring it completely.

    If I set the cookie option at initialization, then everything works as expected.

    If this a bug? Or am i missing something.

    I've set up a page to demonstrate the issue:
    jQuery UI Tab issue

  2. #2
    SitePoint Zealot
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To summarize, the following does not appear to work.

    $( ".selector" ).tabs( "option", "cookie", { expires: 30 } );

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,683
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    When you specify cookies later on, the cookie value is saved.
    When the page is reloaded without specifying that cookies are to be used, the tabs don't know that they should set the tab to the cookie-based value.

    So, if you are later on telling the tabs that you are using cookies, you may-well also have to set the current tab to that which is specified by the cookie value.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •