日期:2014-05-17  浏览次数:20644 次

点击按钮,刷新JSP页面,为什么刷新后滚动条不置顶
下面是我的 onClick 的代码:



function toMainPageResult(curParentIndex) {
var url=window.location.href;
try {
url=url.substring(0,url.indexOf('?'));
}catch(e){};
window.location.href=url+"?curParentIndex="+curParentIndex;
}



window.scrollTo(0,0);加在这个JS 中没有反应啊

------解决方案--------------------
window.moveTo(0,0);
window.resizeTo(window.screen.availWidth,window.screen.availHeight);