Currently have something like so :
$anchor = window.location.hash.replace("#", "");
if ($anchor == 'Home'){
--perform some actions--
}
While this works… it only works when the page is initially accessed. In other words, if I am at test.html and manually add #Home to the url in the browser nothing will happen unless I refresh the page. Is there a way to make this so it is always checking the hashtag rather than just initially on page load? I remember there was a .live or something I used once which seemed to do something similar to what I am looking for.
EDIT :
var $zproductclick = jQuery.noConflict();
$zproductclick('a').live('click', function(event){
if ((window.location.hash.replace("#", "")) == 'home'){
$zproductclick(".homeproduct").add(".networkproduct").add(".parentalproduct").add(".allproduct").hide();
$zproductclick(".homeproduct").add(".allproduct").fadeIn(1000);
$zproductclick("#prodall").add("#prodnet").add("#prodparent").removeClass("active");
$zproductclick("#prodhome").addClass("active");
$zproductclick("#prodversion").removeClass("prodselectno").addClass("prodselect");
}
})
Why do I have to click twice for the actions to occur? It seems it reads the old hash instead of the one immediately after clicking.
EDITED For IE
Working Example
JQuery