I have the following code:
window.pageYOffset
What is the jQuery equivalent to pageYOffset
?
The read-only Window property pageYOffset is an alias for scrollY ; as such, it returns the number of pixels the document is currently scrolled along the vertical axis (that is, up or down) with a value of 0.0, indicating that the top edge of the Document is currently aligned with the top edge of the window's content ...
According to MDN, the pageXoffset and pageYoffset is not deprecated.
You can use $(window).scrollTop()
, This returns an integer.
The API documentation is here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With