Browse Source

top to top, bottom to bottom

pull/46/head
Raphael Eidus 11 years ago
parent
commit
8cd91fee6c
  1. 4
      dist/echo.js
  2. 2
      dist/echo.min.js
  3. 4
      src/echo.js

4
dist/echo.js vendored

@ -123,8 +123,8 @@ window.Echo = (function (global, document, undefined) {
}
offset = {
t: optionToInt(opts.offsetBot, offsetVertical),
b: optionToInt(opts.offsetTop, offsetVertical),
t: optionToInt(opts.offsetTop, offsetVertical),
b: optionToInt(opts.offsetBot, offsetVertical),
l: optionToInt(opts.offsetLeft, offsetHorizontal),
r: optionToInt(opts.offsetRight, offsetHorizontal)
};

2
dist/echo.min.js vendored

@ -1,2 +1,2 @@
/*! Echo v1.5.0 | (c) 2014 @toddmotto | MIT license | github.com/toddmotto/echo */
window.Echo=function(a,b){"use strict";var c,d,e,f,g=[],h=[],i=function(){},j=function(a,b){var c=a.getBoundingClientRect();return c.right>=b.l&&c.bottom>=b.t&&c.left<=b.r&&c.top<=b.b},k=function(){var a,d,e,k,l=g.length;if(k={l:0-c.l,t:0-c.t,b:(window.innerHeight||b.documentElement.clientHeight)+c.b,r:(window.innerWidth||b.documentElement.clientWidth)+c.r},l>0)for(d=0;l>d;d++)e=g[d],e&&j(e,k)&&(f&&(e.setAttribute("data-echo-placeholder",e.src),h.push(e)),e.src=e.getAttribute("data-echo"),i(e,"load"),g.splice(d,1),l=g.length,d--);if(a=h.length,a>0)for(d=0;a>d;d++)e=h[d],e&&!j(e,k)&&(e.src=e.getAttribute("data-echo-placeholder"),i(e,"unload"),h.splice(d,1),a=h.length,d--,g.push(e));0===a&&0===l&&n()},l=function(){clearTimeout(e),e=setTimeout(k,d)},m=function(e){function j(a,b){return parseInt(a||b,10)}var m=b.querySelectorAll("img[data-echo]");e=e||{};var n=e.offset||0,o=e.offsetVertical||n,p=e.offsetHorizontal||n;c={t:j(e.offsetBot,o),b:j(e.offsetTop,o),l:j(e.offsetLeft,p),r:j(e.offsetRight,p)},d=j(e.throttle,250),f=!!e.unload,i=e.callback||i,g=[],h=[];for(var q=0;q<m.length;q++)g.push(m[q]);k(),b.addEventListener?(a.addEventListener("scroll",l,!1),a.addEventListener("load",l,!1)):(a.attachEvent("onscroll",l),a.attachEvent("onload",l))},n=function(){b.removeEventListener?a.removeEventListener("scroll",l):a.detachEvent("onscroll",l),clearTimeout(e)};return{init:m,detach:n,render:k}}(this,document);
window.Echo=function(a,b){"use strict";var c,d,e,f,g=[],h=[],i=function(){},j=function(a,b){var c=a.getBoundingClientRect();return c.right>=b.l&&c.bottom>=b.t&&c.left<=b.r&&c.top<=b.b},k=function(){var a,d,e,k,l=g.length;if(k={l:0-c.l,t:0-c.t,b:(window.innerHeight||b.documentElement.clientHeight)+c.b,r:(window.innerWidth||b.documentElement.clientWidth)+c.r},l>0)for(d=0;l>d;d++)e=g[d],e&&j(e,k)&&(f&&(e.setAttribute("data-echo-placeholder",e.src),h.push(e)),e.src=e.getAttribute("data-echo"),i(e,"load"),g.splice(d,1),l=g.length,d--);if(a=h.length,a>0)for(d=0;a>d;d++)e=h[d],e&&!j(e,k)&&(e.src=e.getAttribute("data-echo-placeholder"),i(e,"unload"),h.splice(d,1),a=h.length,d--,g.push(e));0===a&&0===l&&n()},l=function(){clearTimeout(e),e=setTimeout(k,d)},m=function(e){function j(a,b){return parseInt(a||b,10)}var m=b.querySelectorAll("img[data-echo]");e=e||{};var n=e.offset||0,o=e.offsetVertical||n,p=e.offsetHorizontal||n;c={t:j(e.offsetTop,o),b:j(e.offsetBot,o),l:j(e.offsetLeft,p),r:j(e.offsetRight,p)},d=j(e.throttle,250),f=!!e.unload,i=e.callback||i,g=[],h=[];for(var q=0;q<m.length;q++)g.push(m[q]);k(),b.addEventListener?(a.addEventListener("scroll",l,!1),a.addEventListener("load",l,!1)):(a.attachEvent("onscroll",l),a.attachEvent("onload",l))},n=function(){b.removeEventListener?a.removeEventListener("scroll",l):a.detachEvent("onscroll",l),clearTimeout(e)};return{init:m,detach:n,render:k}}(this,document);

4
src/echo.js

@ -122,8 +122,8 @@ window.Echo = (function (global, document, undefined) {
}
offset = {
t: optionToInt(opts.offsetBot, offsetVertical),
b: optionToInt(opts.offsetTop, offsetVertical),
t: optionToInt(opts.offsetTop, offsetVertical),
b: optionToInt(opts.offsetBot, offsetVertical),
l: optionToInt(opts.offsetLeft, offsetHorizontal),
r: optionToInt(opts.offsetRight, offsetHorizontal)
};

Loading…
Cancel
Save