I'm using a click event to show a hidden inline div. I'm currently using Ben Alman's Jquery hashchange event http://benalman.com/projects/jquery-hashchange-plugin/ so that the forward and backward browser buttons will show the hashtag links in the URL. The issue is the hidden divs stay hidden when you go forward and backwards and I need them to show.
HTML:
<ul>
<li><a href="#link1">Link 1</a></li>
<li><a href="#link2">Link 2</a></li>
<li><a href="#link3">Link 3</a></li>
<li><a href="#link4"><Link 4</a></li>
</ul>
<div id="div1"></div>
<div id="div2"></div>
<div id="div3"></div>
<div id="div4"></div>
Script:
$("#link1").click(function() {
$("#div1").fadeIn("400");
$("#div2, #div3, #div4").hide();
});
$("#link2").click(function() {
$("#div2").fadeIn("400");
$("#div1, #div3, #div4").hide();
});