jquery - Going back a page manually messes things up -


i'm having problem website i'm making friend of mine.

basically home page div image in it, , menu bar links in middle of it. using jquery prevent default action of clicking on link, after menu bar slides up, pressed link becomes active , @ same time image fades out. after redirected selected page. works, it's smooth transition , don't notice page transition. problem is, if redirected page, , press browsers button, return homepage image still disappeared, menu bar in top , previous link still have class "active".

so it's go homepage, in state wherein page has executed jquery. don't want this, has same if refresh page. there way achieve this?

thanks in advance

edit: code:

$( document ).ready(function() {     $('.nav_item a').click(function( event ) {         event.preventdefault();     });      $("#menu").on('click', '.nav_item', function(){         $(this).toggleclass('nav_item_active');         $("#menu").css('top','-10px');         $("#menu").css('background','rgba(89, 89, 89, 0)');         $("#background_image").css('opacity','0');         var href = $(this).find('a').attr('href');          settimeout(function() {             window.location = href;         }, 1300);     });  }); 

never mind, found answer. had add onunload="" body tag.

<body onunload=""> 

Comments

Popular posts from this blog

rest - Spring boot: Request method 'PUT' not supported -

php - Magento - Deleted Base url key -

symfony - imagine_filter() not generating the correct url in LiipImagineBundle -