Sha256: 5f3897fbac921322759749f0caaee5bcd0aa661ae6de49e0a404e296d6678141

Contents?: true

Size: 911 Bytes

Versions: 19

Compression:

Stored size: 911 Bytes

Contents

<html>
  <head>
    <script>
      function isElementInViewport(el) {
        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
        );
      }
    </script>
  </head>
  <body>
    <div style="height: 180%; position: relative;">
      <button style="position: absolute;">Top</button>
      <button style="position: absolute; top: 50%;">Center</button>
      <button style="position: absolute; bottom: 0;">Bottom</button>
    </div>
  </body>
</html>

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
watir-7.0.0 spec/watirspec/html/scroll.html
watir-7.0.0.beta5 spec/watirspec/html/scroll.html
watir-7.0.0.beta4 spec/watirspec/html/scroll.html
watir-7.0.0.beta3 spec/watirspec/html/scroll.html
watir-7.0.0.beta2 spec/watirspec/html/scroll.html
watir-7.0.0.beta1 spec/watirspec/html/scroll.html
watir-6.19.1 spec/watirspec/html/scroll.html
watir-6.19.0 spec/watirspec/html/scroll.html
watir-6.18.0 spec/watirspec/html/scroll.html
watir-6.17.0 spec/watirspec/html/scroll.html
watir-6.16.5 spec/watirspec/html/scroll.html
watir-6.16.4 spec/watirspec/html/scroll.html
watir-6.16.3 spec/watirspec/html/scroll.html
watir-6.16.2 spec/watirspec/html/scroll.html
watir-6.16.1 spec/watirspec/html/scroll.html
watir-6.16.0 spec/watirspec/html/scroll.html
watir-scroll-0.4.0 spec/support/test.html
watir-scroll-0.3.0 spec/support/test.html
watir-scroll-0.2.0 spec/support/test.html