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
精彩评论