I have 20 list items inside of a div that can only show 5 at a time. What is a good way to scroll to item #10, and then item #20? I know the height of all the items.
The scrollTo plugin does this, but its source is not super easy to understand without really getting into it. I don't want to use this plugin.
Let's say I have a function that takes 2 elements $parentDiv
, $innerListItem
, neither $innerListItem.offset().top
nor $innerListItem.positon().top
gives me the correct scrollTop for $parentDiv.