I have a div with lots of elements inside it, and overflow: scroll
. Then i want to be able to scroll the nth element in view. I set a fiddle to it, but I can't find the expression to get the element position relative to the parent.
http://jsfiddle.net/bortao/NXcTK/
I tried both el.position().top
and el.offset().top
but they don't work.
Note: h / 2
is so the element is positioned in the middle of the div.