toddmotto / echo

Lazy-loading images with data-* attributes

Home Page:http://toddmotto.com/labs/echo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need option to exclude invisible elements

teohhanhui opened this issue · comments

Perhaps we can add an option to check whether an element is visible:

The simplest:

var isVisible = element.offsetWidth > 0 || element.offsetHeight > 0;

Or if we want to go full crazy: http://useallfive.com/thoughts/javascript-tool-detect-if-a-dom-element-is-truly-visible/