Ok guys, I started to learn more about Jquery and now I could make this simple script, which keeps my tabs opened on changing pages, but there’s an annoying bug.
The tab opens before my DOM finishes loading, and it looks like weird. So you open a tab in a page and than later, when the next page is fully loaded, the tab opens.
What I want is to keep opened the tab, or at least have it look like the tab is opened.
In the cookie I store the id of the element that I want to show
$(document).ready(function(){
var cookie = $.cookie("current");
if(cookie != null){
$("#"+cookie).show()
$.cookie("current" , null);
}
});
I am slightly confused as to what you are asking but
$(document).ready()doesn’t run until the DOM has loaded.If you want to wait for everything to load then you can use
$(window).load()in it’s place as this waits for things like images on the page to finish also.