diff --git a/dist/echo.js b/dist/echo.js index 5eadf57..7dfb1c1 100644 --- a/dist/echo.js +++ b/dist/echo.js @@ -16,10 +16,14 @@ window.Echo = (function (window, document, undefined) { return (coords.top >= 0 && coords.left >= 0 && coords.top) <= (window.innerHeight || document.documentElement.clientHeight); }; + var _getStyle = function(el, prop) { + return window.getComputedStyle ? window.getComputedStyle(el, null).getPropertyValue(prop) : el.currentStyle[prop]; + }; + var _pollImages = function () { for (var i = 0; i < store.length; i++) { var self = store[i]; - if (_inView(self)) { + if (_inView(self) && (_getStyle(self, 'display') !== 'none' && _getStyle(self.parentNode, 'display') !== 'none')) { self.src = self.getAttribute('data-echo'); if ([].indexOf && [].slice.call(store).indexOf(self) !== -1) { [].slice.call(store).splice(i, 1);