Sha256: 74cdb234e5f1a8827e772796e19998d85b5a602a9bb60d48d4c4d6a54897ae1c

Contents?: true

Size: 521 Bytes

Versions: 5

Compression:

Stored size: 521 Bytes

Contents

function(){
    var el = arguments[0];
    var top = el.offsetTop;
    var left = el.offsetLeft;
    var width = el.offsetWidth;
    var height = el.offsetHeight;

    while (el.offsetParent) {
        el = el.offsetParent;
        top += el.offsetTop;
        left += el.offsetLeft;
    }

    return (
        top < (window.pageYOffset + window.innerHeight) &&
        left < (window.pageXOffset + window.innerWidth) &&
        (top + height) > window.pageYOffset &&
        (left + width) > window.pageXOffset
    );
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
watir-7.3.0 lib/watir/js_snippets/isElementInViewport.js
watir-7.2.2 lib/watir/js_snippets/isElementInViewport.js
watir-7.2.1 lib/watir/js_snippets/isElementInViewport.js
watir-7.2.0 lib/watir/js_snippets/isElementInViewport.js
watir-7.1.0 lib/watir/js_snippets/isElementInViewport.js