Jonathan D
Jonathan D

Reputation: 1364

Javascript Scrollbar

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

Answers (2)

Shakti Singh
Shakti Singh

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

WaiLam
WaiLam

Reputation: 1007

You can try this jquery plugin.

http://demos.flesler.com/jquery/scrollTo/

Upvotes: 1

Related Questions