complez
complez

Reputation: 8322

Scroll to item in overflow:auto div

I have an overflow:auto div with specific max-height. That div contains many items as a list. I try to make a scroll script but seem it missing something.

Here is my code: http://jsfiddle.net/UX5cd/6/

Upvotes: 1

Views: 1131

Answers (3)

user1307380
user1307380

Reputation: 1

Easiest way:

[code] $(".orderedList").scrollToElement($(".orderedList .selected")); [/code]

KR

Upvotes: 0

try adding this:

body { margin: 0; padding: 0; }

to your stylesheet;

Upvotes: 1

Scott Evernden
Scott Evernden

Reputation: 39940

try resetting the div's scrollTop to zero before you read the chosen item's offset

Upvotes: 3

Related Questions