Jquery UI - reload selected tab?

后端 未结 5 520
粉色の甜心
粉色の甜心 2021-02-04 17:30

Is there a way to reload the selected tab I know there is the .load() function. But it wants a tab index and I don\'t seem to see a way to grab the selected tabs id.

5条回答
  •  猫巷女王i
    2021-02-04 18:19

    Download this Plugin for cookies:

    http://plugins.jquery.com/cookie/

    Insert jQuery cookie to your page

     
    

    and add this :

    $(".tabs").click(function() {
        //getter , get the active tab
        var active = $( "#tabs" ).tabs( "option", "active" );
        $.cookie("tabs_selected", active);
    });
    
    var cookieValue = $.cookie("tabs_selected");
    // setter, set the active tab stocked 
    $( "#tabs" ).tabs( "option", "active",cookieValue );
    

提交回复
热议问题