开发者

How to automatically Scroll a text window on loading it

I have a html text box with scroll. Is it possible to get the box to scroll to a ce开发者_高级运维rtain point on loading ?


You can use scrollTop

document.getElementById('your_div_id').scrollTop = 50;


you can use an id on a certain point in the text:

<span id='scrollTo'>lorem ipsum...</span>

and then in the URL:

localhost/index.html#scrollTo

or:

if you want to go the javascript route you can use the jquery $.scroll method

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜