How to let the chrome forget the page scroll position?


Tags: javascript,css,google-chrome,scroll

Problem :

For instance, I open a web page, and scroll down to some position,

then I refresh the chrome browser, the browser could scroll the previous position again

How can I use javascript or css to let the browser to forget the scroll?

I have try $(window).scrollTop(0), but it doesn't work



Solution :

A simple way that I can say is to run this code on page load:

document.location = "#";

OR

window.scrollTo(0);

It set the browser viewport to the top of the page, again.


    CSS Howto..

    How to reduce font size on a defined css style?

    How to improve the performance of this CSS animation?

    CSS transition: how to produce this effect (linking transitions)

    Where do I put my CSS, how do I link to it from the master page?

    simplest slideshow using html, css toggling visibility of each div tag

    How to style jQuery UI's autocomplete list for mouse leave event?

    How to set two background color to one element in CSS?

    How to use preloaded CSS spritesheet in javascript?

    How can I create the behavior of a two-frame horizontal-tiled frameset with divs/css?

    How to make a div to float left/right inside a centered div

    How to hide and show div border line in my case?

    ASP.NET - how to retrieve CSS styles applied by javascript on page postback?

    How to add Bootstrap to Fullpage.js

    How to isolate specific platforms using CSS selectors in the Ionic framework

    how to connect circles with lines without ovelaping

    How to create a border that does't add a margin?

    How to set two divs side by side

    How To Implement 2D Perspective Within a 3D Space (CSS & jQuery)

    CSS opacity, how to have opaque elements in transparent container element

    Gradient css borders not showing in internet explorer an firefox

    CSS: How to move hint box (a:hover) to the left?

    How to toggle multiple images in jquery?

    How to make CSS width to fill parent?

    How to Display a DIV with 'fixed' and 'inline-block' Added to its CSS Properties

    How to use the compass transition mixins with a translateX property and autoprefixer?

    How to make a horizontal div scroll bar float like a fixed CSS div

    How to put all css files in one file and all javascript files in one file

    How to center text in my div

    how to reduce the size of all component in sencha application

    How can we prevent that when I resize my window, my images move using HTML-CSS?