How to get the height from the edge of the div before the start of the document?

5a9917a328e77458696522.png

tried to watch these https://learn.javascript.ru/coordinates-document and these https://learn.javascript.ru/metrics materials but do not see obvious solutions

theoretically, there is still this option
shpargalkablog.ru/2013/09/scroll-block.html
but understand that you need to do this yourself, as it will be possible to implement it more successfully than if you just copy
June 7th 19 at 14:51
1 answer
June 7th 19 at 14:53
Solution
but that option is not correct?
jQuery('div').offset().top
https://jsfiddle.net/42x0uvod/
I don't ispolzuu jq is too easy and not suitable for my purposes - Hattie.Purdy28 commented on June 7th 19 at 14:56
alert(document.getElementById("filter_sticky").offsetTop)
- so not too srabatyvaet i.e. 0 260 displays in there - Hattie.Purdy28 commented on June 7th 19 at 14:59
,
offsetTop show the position of the element relative to the parent - nikolas.Reichert commented on June 7th 19 at 15:02
,
alert(document.getElementById("filter_sticky").offsetTop)


alert(document.getElementById("filter_sticky").getBoundingClientRect().top + window.pageYOffset)
- nikolas.Reichert commented on June 7th 19 at 15:05
thanks said solution - Hattie.Purdy28 commented on June 7th 19 at 15:08
thank - nikolas.Reichert commented on June 7th 19 at 15:11
,
I don't ispolzuu jq is too easy and not suitable for my purposes

and share if not secret what for such purpose? why too easy? - idell_Kassulke commented on June 7th 19 at 15:14
the goal is to earn more, i.e. the more you know the more successful can use
specifically, in my case it is the transition VUE and REACT where it is not desirable to use JQ in many custom projects JQ as worked and will work - Hattie.Purdy28 commented on June 7th 19 at 15:17

Find more questions by tags JavaScript