Reputation: 1364
I have a div which has a max height and a scroll bar on it.
In the div is a large list of items
(<ul><li></li>...</ul>)
How do i in JavaScript make it so on page load it scrolls the div so that it is showing a certain list item?
Thanks.
Upvotes: 0
Views: 185
Reputation: 86446
you can try to do with the scrollTop property of div. for an example.
div.scrollTop=200
you can make a function and call it on onload
event.
may help you.
Thanks.
Upvotes: 0
Reputation: 1007
You can try this jquery plugin.
http://demos.flesler.com/jquery/scrollTo/
Upvotes: 1