Jquery Tabs with Cookies

时光毁灭记忆、已成空白 提交于 2019-12-11 09:38:21

问题


I am using Jquery tabs using Cookies provided by Jquery and is working perfect as When I refresh the page the selected tab remains the same.
I used following code:

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

But when I navigate to other page and come back the selected tab remains the same. At this point I want the first tab to be get selected and not the one that I have previously selected before navigating to other page.
Will it be possible to use cookies only for refreshing the page and not after navigating to other page? If yes, how?


回答1:


For this you can create the tabs with cookie and when you navigate to other pages you need to manually delete the cookie. For erasing pass the current time stamp to document.cookie. Go through the following link for the detail explaination.



来源:https://stackoverflow.com/questions/12453641/jquery-tabs-with-cookies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!