Mees Boeijen Mees Boeijen - 4 months ago 16
HTML Question

Chrome remembers scroll position

I'm running into a problem that's actually a "feature" on Chrome.
As most of you might know, Chrome remembers a scroll position that it returns to, whenever you come back to a page. And I kind of have a problem with that.

Is there any way to override this without the user noticing?

Mees

Failed try-outs:


  • ScrollTop on document.ready


Answer

I've checked on chrome, it worked well. Sometimes setTimeout does trick :)

<script type="text/javascript">
window.onload=function(){
    setTimeout(function(){
        scrollTo(0,-1);
    },0);
}
</script>
Comments