diff --git a/dist/echo.js b/dist/echo.js index d33b5ed..5073802 100644 --- a/dist/echo.js +++ b/dist/echo.js @@ -1,4 +1,4 @@ -/*! Echo v1.4.0 | (c) 2013 @toddmotto | MIT license | github.com/toddmotto/echo */ +/*! Echo v1.4.0 | (c) 2014 @toddmotto | MIT license | github.com/toddmotto/echo */ window.Echo = (function (window, document, undefined) { 'use strict'; @@ -7,7 +7,11 @@ window.Echo = (function (window, document, undefined) { var _inView = function (el) { var coords = el.getBoundingClientRect(); - return ((coords.top >= 0 && coords.left >= 0 && coords.top) <= (window.innerHeight || document.documentElement.clientHeight) + parseInt(offset)); + return ( + (coords.top >= 0 && coords.left >= 0) && + coords.top <= (window.innerHeight || document.documentElement.clientHeight) + parseInt(offset) && + coords.left <= (window.innerWidth || document.documentElement.clientWidth) + parseInt(offset) + ); }; var _pollImages = function () { diff --git a/dist/echo.min.js b/dist/echo.min.js index 4dfeda4..d55a451 100644 --- a/dist/echo.min.js +++ b/dist/echo.min.js @@ -1,2 +1,2 @@ -/*! Echo v1.4.0 | (c) 2013 @toddmotto | MIT license | github.com/toddmotto/echo */ -window.Echo=function(a,b){"use strict";var c,d,e,f=[],g=function(d){var e=d.getBoundingClientRect();return(e.top>=0&&e.left>=0&&e.top)<=(a.innerHeight||b.documentElement.clientHeight)+parseInt(c)},h=function(){for(var a=f.length;a--;){var b=f[a];g(b)&&(b.src=b.getAttribute("data-echo"),f.splice(a,1))}},i=function(){clearTimeout(e),e=setTimeout(h,d)},j=function(e){var g=b.querySelectorAll("[data-echo]"),h=e||{};c=h.offset||0,d=h.throttle||250;for(var j=0;j=0&&e.left>=0&&e.top<=(a.innerHeight||b.documentElement.clientHeight)+parseInt(c)&&e.left<=(a.innerWidth||b.documentElement.clientWidth)+parseInt(c)},h=function(){for(var a=f.length;a--;){var b=f[a];g(b)&&(b.src=b.getAttribute("data-echo"),f.splice(a,1))}},i=function(){clearTimeout(e),e=setTimeout(h,d)},j=function(e){var g=b.querySelectorAll("[data-echo]"),h=e||{};c=h.offset||0,d=h.throttle||250;for(var j=0;j= 0 && coords.left >= 0 && coords.top) <= (window.innerHeight || document.documentElement.clientHeight) + parseInt(offset)); + return ( + (coords.top >= 0 && coords.left >= 0) && + coords.top <= (window.innerHeight || document.documentElement.clientHeight) + parseInt(offset) && + coords.left <= (window.innerWidth || document.documentElement.clientWidth) + parseInt(offset) + ); }; var _pollImages = function () {