javascript - catch element that was #hash Jquery -
example:
if go google.com/#search
function checkhash(){ if(window.location.hash != hash) { $("elementhashed").animate( { backgroundcolor: "#ff4500" }, 1 ).animate( { backgroundcolor: "fff" }, 1500 ); hash = window.location.hash; } t=settimeout("checkhash()",400); };
or if go google.com/#any hash
how element http://url/#elementid without defining single element
example of single element:
function checkhash(){ if(window.location.hash != hash) { $(".body").animate( { backgroundcolor: "#ff4500" }, 1 ).animate( { backgroundcolor: "fff" }, 1500 ); hash = window.location.hash; } t=settimeout("checkhash()",400); };
the following hash , run in jquery. basically, element
$(window.location.hash);
to animate it, add .animate()
$(window.location.hash).animate({/* code */ backgroundcolor: '#ff4500' }, 1);
Comments
Post a Comment