I am building a website which I am publishing with div
s.(我正在建立要与div
发布的网站。)
When I refresh the page after it was scrolled to position X, then the page is loaded with the scroll position as X.(当页面滚动到位置X后刷新页面时,页面的滚动位置为X。)
How can I force the page to be scrolled to the top on page refresh?(如何强制页面滚动到页面刷新的顶部?)
What I can think of is of some JS or jQuery run as onLoad()
function of the page to SET the pages scroll to top.(我能想到的是作为页面的onLoad()
函数运行的某些JS或jQuery,以设置页面滚动到顶部。) But I don't know how I could do that.(但是我不知道该怎么办。)
A better option would be if there is some property or something to have the page loaded with its scroll position as default (ie at the top) which will be kind of like page load , instead of page refresh .(一个更好的选择是,如果有一些属性或东西要让页面默认加载其滚动位置(即,顶部),这有点像页面加载 ,而不是页面刷新 。)
ask by Moon translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…