9 examples of 'pageyoffset' in JavaScript

Every line of 'pageyoffset' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
23static get windowScrollY() {
24 return (window.pageYOffset || window.scrollY || 0);
25}
40function getPageY() {
41 return window.pageYOffset || document.body.scrollTop;
42}
15_getScrollTop() {
16 if (this._rootNode === window) {
17 return this._rootNode.pageYOffset;
18 }
19 if (this._rootNode === document) {
20 return this._rootNode.defaultView.pageYOffset;
21 }
22}
119function pageY (elem) {
120 return elem.offsetParent ? elem.offsetTop + pageY(elem.offsetParent) : elem.offsetTop;
121}
399function offsetScroll () {
400 if (pjax.scrollOffsetSelector) {
401 const elem = document.querySelector(pjax.scrollOffsetSelector)
402 const style = getComputedStyle(elem)
403 if (style.position === 'fixed' && style.top === '0px') {
404 window.scrollBy(0, -elem.getBoundingClientRect().height)
405 }
406 }
407}
280getScrollTop() {
281 return (
282 window.pageYOffset ||
283 document.documentElement.scrollTop ||
284 document.body.scrollTop ||
285 0
286 )
287}
491function scrollbar_offset () {
492 return scrollbar_offset_filter_results (
493 window.pageYOffset ? window.pageYOffset : 0,
494 document.documentElement ? document.documentElement.scrollTop : 0,
495 document.body ? document.body.scrollTop : 0
496 );
497}
8public currentYPosition() {
9 // Firefox, Chrome, Opera, Safari
10 if (self.pageYOffset) {
11 return self.pageYOffset;
12 }
13 // Internet Explorer 6 - standards mode
14 if (document.documentElement && document.documentElement.scrollTop) {
15 return document.documentElement.scrollTop;
16 }
17 // Internet Explorer 6, 7 and 8
18 if (document.body.scrollTop) {
19 return document.body.scrollTop;
20 }
21 return 0;
22}
75getOffsetTop(){
76 return this.el.offsetTop;
77}

Related snippets