开发者

Scrollbar position problem on location.reload()

<div style='height:2000px;'>please scroll down</div>
<a href=# onclick="location.reload();return false;">Reload Page</a>
<div style='hei开发者_运维技巧ght:1000px;'>...</div>

demo here

in chrome or firefox,when I click "Reload Page",the page can revert to my scrolltop,

but in IE(6,7,8),they stay on the top

how to implement revert scrolltop effect like chrome in IE?

thanks for help :)


Use scroll function, here's an example:

  • http://www.java2s.com/Code/JavaScript/Javascript-Objects/WindowscrollExample.htm

Here's an example of <a> similar to what you want:

<a href="javascript:scroll(0,0)">
Top
</a>

You can combine both if you actually want to scroll and reload.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜