I just launched http://elliewauters.com & have a little problem that I'd like to fix, the site uses a lot of animated horizontal scrolling to go from one 'page' to the next, but on refresh most browsers remember the scroll position & go back to where I was before, I do not want this. Try going to the 'About' page & then refreshing. You'll see that the logo & menu are in the middle of the page as they where when you arrived at the site for the first time.
I would like help with either of two things:
- To reset the scroll position back to 0,0 on page refresh OR
- To move the logo & menu to the top if the scrollLeft value is greater than 1.
I have tried using $(window).scrollLeft(0);
to no avail &
scrollLeft = $(window).scrollLeft();
console.log(scrollLeft)
if (scrollLeft>1) {
$('#header').addClass('notLeft').css('top','0%');
} else {
$('#header').addClass('left').css('top','25%');
}
does not work, does anyone please have an idea of how I could achieve what I want?
Thanks in advance