40
rated 0 times
[
45]
[
5]
/ answers: 1 / hits: 51382
/ 8 Years ago, wed, march 23, 2016, 12:00:00
I need to get the top position of an element relative to the top of the viewport, not the whole document.
I tried offset().top;
which returns the top position relative to the document, and I tried scrollTop()
which always returns 0
regardless of the element's visibility in the viewport.
More From » jquery