Home > Enterprise >  How can i get Y position in all the website page
How can i get Y position in all the website page

Time:04-28

I have a website which is 6 viewports height. I would like to get the Y position for no matter where i am in the page not only the viewport. I have tried :

  • event.pageY ;
  • element.getBoundingClientRect();
  • window.innerHeight / outerheight;

It doesn't solve my problem.

Thanks

CodePudding user response:

thanks Alexei Petrenko but it calculates an element position. But I fix my problem with "window.scrollY" that take the number of pixel from the top.

  • Related