Browse Source

change offsetBot to offsetBottom

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

4
README.md

@ -51,10 +51,10 @@ Type: `Number|String` Default: `offsetVertical`'s value
The `offsetTop` option allows you to specify how far above the viewport you want Echo to _begin_ loading your images.
#### offsetBot
#### offsetBottom
Type: `Number|String` Default: `offsetVertical`'s value
The `offsetBot` option allows you to specify how far below the viewport you want Echo to _begin_ loading your images.
The `offsetBottom` option allows you to specify how far below the viewport you want Echo to _begin_ loading your images.
#### offsetLeft
Type: `Number|String` Default: `offsetVertical`'s value

4
dist/echo.js vendored

@ -103,7 +103,7 @@ window.Echo = (function (global, document, undefined) {
* @param {Object} [opts] Passed in Object with options
* @param {Number|String} [opts.throttle]
* @param {Number|String} [opts.offset]
* @param {Number|String} [opts.offsetBot]
* @param {Number|String} [opts.offsetBottom]
* @param {Number|String} [opts.offsetTop]
* @param {Number|String} [opts.offsetLeft]
* @param {Number|String} [opts.offsetRight]
@ -124,7 +124,7 @@ window.Echo = (function (global, document, undefined) {
offset = {
t: optionToInt(opts.offsetTop, offsetVertical),
b: optionToInt(opts.offsetBot, offsetVertical),
b: optionToInt(opts.offsetBottom, 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.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);
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.offsetBottom,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

@ -102,7 +102,7 @@ window.Echo = (function (global, document, undefined) {
* @param {Object} [opts] Passed in Object with options
* @param {Number|String} [opts.throttle]
* @param {Number|String} [opts.offset]
* @param {Number|String} [opts.offsetBot]
* @param {Number|String} [opts.offsetBottom]
* @param {Number|String} [opts.offsetTop]
* @param {Number|String} [opts.offsetLeft]
* @param {Number|String} [opts.offsetRight]
@ -123,7 +123,7 @@ window.Echo = (function (global, document, undefined) {
offset = {
t: optionToInt(opts.offsetTop, offsetVertical),
b: optionToInt(opts.offsetBot, offsetVertical),
b: optionToInt(opts.offsetBottom, offsetVertical),
l: optionToInt(opts.offsetLeft, offsetHorizontal),
r: optionToInt(opts.offsetRight, offsetHorizontal)
};

Loading…
Cancel
Save