Answers for "Detecting by how much user has scrolled | get how much i scroll in js"

0

Detecting by how much user has scrolled | get how much i scroll in js

//To detect how much the user has scrolled the page vertically in terms of pixels from the very top, in JavaScript, we would probe either window.pageYOffset, or 
//in older versions of IE, one of several variants of document.body.scrollTop, whichever property is supported:
var scrollTop = window.pageYOffset || (document.documentElement || document.body.parentNode || document.body).scrollTop
//Using jQuery instead, the equivalent would be:
var scrollTop = $(window).scrollTop() //best
Posted by: Guest on September-14-2021

Code answers related to "Detecting by how much user has scrolled | get how much i scroll in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language