MCPcopy
hub / github.com/deepch/RTSPtoWebRTC / getScroll

Function getScroll

web/static/js/bootstrap.bundle.js:1789–1802  ·  view source on GitHub ↗

* Gets the scroll value of the given element in the given side (top and left) * @method * @memberof Popper.Utils * @argument {Element} element * @argument {String} side `top` or `left` * @returns {number} amount of scrolled pixels

(element)

Source from the content-addressed store, hash-verified

1787 * @returns {number} amount of scrolled pixels
1788 */
1789 function getScroll(element) {
1790 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
1791
1792 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
1793 var nodeName = element.nodeName;
1794
1795 if (nodeName === 'BODY' || nodeName === 'HTML') {
1796 var html = element.ownerDocument.documentElement;
1797 var scrollingElement = element.ownerDocument.scrollingElement || html;
1798 return scrollingElement[upperSide];
1799 }
1800
1801 return element[upperSide];
1802 }
1803
1804 /*
1805 * Sum or subtract the element scroll values (left and top) from a given rect object

Callers 3

includeScrollFunction · 0.85
getBoundingClientRectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected