I have this code that works fine (just scroll down) in firefox and chrome, but if you then load the browser 'back' (chrome) it does trigger in> load page without me doing scroll . In Html I have:
'<body onunload="">...'
js.js
$(document).ready(function() {
window.scrollTo(0, 0); // ir logo para topo no load da pagina para evitar
// que faça trigger à animação sem eu fazer scroll
.......
$(window).scroll(function() {
if ($(window).scrollTop() > 10){
var href = $('.toWork').attr('href');
$('#wrapper').animate({
"margin-top": "-1000px"
}, 800, function(){
window.location=href;
});
}
});
})