27 lines
653 B
JavaScript
27 lines
653 B
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
/**
|
|
* Returns a number of pixels from the top of the screen for given dom element.
|
|
*
|
|
* @param {object} dom element
|
|
* @returns {number} A position from the top of the screen in pixels
|
|
*/
|
|
var getOffsetTop = exports.getOffsetTop = function getOffsetTop(elem) {
|
|
var yPos = elem.offsetTop;
|
|
var tempEl = elem.offsetParent;
|
|
|
|
while (tempEl != null) {
|
|
yPos += tempEl.offsetTop;
|
|
tempEl = tempEl.offsetParent;
|
|
}
|
|
|
|
return yPos;
|
|
};
|
|
|
|
var isIOS = exports.isIOS = function isIOS() {
|
|
return (/iPad|iPhone|iPod/.test(window.navigator.userAgent) && !window.MSStream
|
|
);
|
|
}; |