I'm working on my new website but I have a little bit of a problem. Let's take a look at my code:
$(".item2").click(function(){
$(".item1").removeClass("underline");
$(this).addClass("underline");
$('html, body').delay(500).animate({ scrollTop:0 }, 'slow');
});
So I'm trying to have it work like this:
- Click the link;
- Have the page scroll to the bottom (because the page content can change the page height, so it needs to scroll back to the footer after clicking the link);
- Stay at bottom so the user can read the footer again
My code above doesn't work for some reason. The delay(500)
doesn't work and therefore ignores the rest of the code for some reason.