Hello i want to get the previous clicked a href. The site doesnt reload.
<li><a href="#section3"><b>Restaurant</b></a></li>
This jumps to div id=section3
<script type="text/javascript">
$(function() {
$('a[href*="section"]').bind('click',function(event){
var $anchor = $(this);
var addressValue = $(this).attr("href");
$(addressValue).css("display","block");
$('html, body').animate({
scrollLeft: $($anchor.attr('href')).offset().left
}, 1000,'easeInOutExpo',function(){
});
var allsections = '#section2,#section3,#section4,#section5,#section6,#section7,#section8,#section9,#section10,#section11,#section12, #section13,#section14,#section15,#section16,#section17,#section18,#section19,#section20,#section21,#section22';
var removedsec = allsections.replace(addressValue+",",'');
// alert(removedsec);
setTimeout(function () {
$(removedsec).removeAttr("style");
}, 100)
});
});
</script>
The divs are all displayed none. If i click on a link it set the actual div on block. I need to let the previous clicked link to be displayed block to. If than the next link is clicked the first div should be set do display none.
Could i explain how i want it :D