From dd712f936478b8189bc6e1b2d7a4bf181cc8e842 Mon Sep 17 00:00:00 2001 From: Todd Motto Date: Sun, 17 Nov 2013 16:52:41 +0000 Subject: [PATCH] Added IE8 support, hooray! --- README.md | 2 +- dist/echo.js | 4 ++-- dist/echo.min.js | 2 +- src/echo.js | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6f1a295..3637cae 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Echo [![Build Status](https://travis-ci.org/toddmotto/echo.png)](https://travis-ci.org/toddmotto/echo) -Echo is a standalone JavaScript lazy-loading image tool. Echo is fast, less than 1KB and uses HTML5 data-* attributes. +Echo is a standalone JavaScript lazy-loading image tool. Echo is fast, less than 1KB and uses HTML5 data-* attributes. Echo works in IE8+. ```html Photo diff --git a/dist/echo.js b/dist/echo.js index 9122a2d..1945a28 100644 --- a/dist/echo.js +++ b/dist/echo.js @@ -21,7 +21,7 @@ window.Echo = (function (window, document, undefined) { var self = store[i]; if (_inView(self)) { self.src = self.getAttribute('data-echo'); - if (store.indexOf(self) !== -1) { + if ([].indexOf && store.indexOf(self) !== -1) { store.splice(i, 1); } } @@ -29,7 +29,7 @@ window.Echo = (function (window, document, undefined) { }; var init = function () { - store = [].slice.call(document.querySelectorAll('[data-echo]')); + store = document.querySelectorAll('[data-echo]'); _pollImages(); window.onscroll = _pollImages; }; diff --git a/dist/echo.min.js b/dist/echo.min.js index df6704e..adfcb59 100644 --- a/dist/echo.min.js +++ b/dist/echo.min.js @@ -5,4 +5,4 @@ * by Todd Motto: http://toddmotto.com * Copyright. MIT licensed. */ -window.Echo=function(a,b){"use strict";var c,d=function(c){var d=c.getBoundingClientRect();return(d.top>=0&&d.left>=0&&d.top)<=(a.innerHeight||b.documentElement.clientHeight)},e=function(){for(var a=0;a=0&&d.left>=0&&d.top)<=(a.innerHeight||b.documentElement.clientHeight)},e=function(){for(var a=0;a