Remember which tab was active after refresh

前端 未结 17 2244
眼角桃花
眼角桃花 2020-11-27 04:43

I\'m using jquery tabs on a web page and when the page is refreshed it loses what ever tab I had been on and goes back to the first tab.

Has anyone come across this

17条回答
  •  悲哀的现实
    2020-11-27 05:15

    Do you think you can add same function on below code.

    $(".menu > li").click(function(e){
        $(".content." + $(".menu > .active").attr("id")).fadeOut("fast", function() {
            $(".content." + e.target.id).fadeIn();
            $(".menu > #" + e.target.id).addClass("active");
        });
    
        $(".menu > .active").removeClass("active");
    
        return true;
    
    });
    

提交回复
热议问题