Reputation: 2367
Im looking for a simple cross-browser plugin or method that can help me do this :
$('#clear_window').click(function(){
$('#window').fadeOut(50);
var activeTab = $("ul.tabs li.active").find("a").attr("href");
$(activeTab).fadeIn(50);
});
but on the click of the browsers back button not on the #clear_window click
Upvotes: 0
Views: 953
Reputation: 227
You can through HTML5 History API. But this only supported by Gecko (Firefox), Chrome and Internet Explorer 10+
For what you want you can read it in MDN documentation.
However, if you can how your application handle your URLs, then you can implement it through the hashchange event, similar to how this jQuery plugin handles it.
Upvotes: 1
Reputation: 3721
You cannot detect broswer's back button click. The only way to do is to detect "leave page" event. This might help... Best way to detect when a user leaves a web page?
Upvotes: 0