Sha256: a212967d103f0733ba2b3ec39bca56840fd23b91ef50b9a54981f26792f3d655
Contents?: true
Size: 867 Bytes
Versions: 104
Compression:
Stored size: 867 Bytes
Contents
/* global dom */ /*eslint complexity: ["error", 14]*/ /** * Get the scroll offset of the document passed in * @method getScrollOffset * @memberof axe.commons.dom * @instance * @param {Document} element The element to evaluate, defaults to document * @return {Object} Contains the attributes `x` and `y` which contain the scroll offsets */ dom.getScrollOffset = function(element) { 'use strict'; if (!element.nodeType && element.document) { element = element.document; } // 9 === Node.DOCUMENT_NODE if (element.nodeType === 9) { var docElement = element.documentElement, body = element.body; return { left: (docElement && docElement.scrollLeft) || (body && body.scrollLeft) || 0, top: (docElement && docElement.scrollTop) || (body && body.scrollTop) || 0 }; } return { left: element.scrollLeft, top: element.scrollTop }; };
Version data entries
104 entries across 104 versions & 1 rubygems