diff --git a/dist/echo.js b/dist/echo.js index a321967..ba20240 100644 --- a/dist/echo.js +++ b/dist/echo.js @@ -1,6 +1,6 @@ /*! * Echo - * @version 1.0.0 + * @version 1.1.0 * @author Todd Motto http://toddmotto.com * Project: https://github.com/toddmotto/echo * @@ -16,15 +16,13 @@ window.echo = (function (window, document) { */ var Echo = function (elem) { this.elem = elem; - this.render(); - this.listen(); }; /* * Images for echoing */ var echoStore = []; - + /* * Element in viewport logic */ @@ -70,16 +68,6 @@ window.echo = (function (window, document) { Echo.prototype = { init : function () { echoStore.push(this.elem); - }, - render : function () { - if (document.addEventListener) { - document.addEventListener('DOMContentLoaded', echoImages, false); - } else { - window.onload = echoImages; - } - }, - listen : function () { - window.onscroll = echoImages; } }; @@ -91,4 +79,14 @@ window.echo = (function (window, document) { new Echo(lazyImgs[i]).init(); } -})(window, document); \ No newline at end of file + /* + * Bind the events + */ + if (document.addEventListener) { + document.addEventListener('DOMContentLoaded', echoImages, false); + } else { + window.onload = echoImages; + } + window.onscroll = echoImages; + +})(window, document); diff --git a/dist/echo.min.js b/dist/echo.min.js index 885edf5..09ee094 100644 --- a/dist/echo.min.js +++ b/dist/echo.min.js @@ -1,10 +1,10 @@ /*! * Echo - * @version 1.0.0 + * @version 1.1.0 * @author Todd Motto http://toddmotto.com * Project: https://github.com/toddmotto/echo * * Raw JavaScript lazy-loading images with HTML5 data-* attributes. * Copyright 2013. MIT licensed. */ -window.echo=function(a,b){"use strict";var c=function(a){this.elem=a,this.render(),this.listen()},d=[],e=function(c){var d=c.getBoundingClientRect();return(d.top>=0&&d.left>=0&&d.top)<=(a.innerHeight||b.documentElement.clientHeight)},f=function(a,b){a.src=a.getAttribute("data-echo"),b&&b()},g=function(a,b){-1!==d.indexOf(a)&&d.splice(b,1)},h=function(){for(var a=0;a=0&&d.left>=0&&d.top)<=(a.innerHeight||b.documentElement.clientHeight)},f=function(a,b){a.src=a.getAttribute("data-echo"),b&&b()},g=function(a,b){-1!==d.indexOf(a)&&d.splice(b,1)},h=function(){for(var a=0;a