diff --git a/src/echo.js b/src/echo.js index 5cae710..53250cd 100644 --- a/src/echo.js +++ b/src/echo.js @@ -10,19 +10,18 @@ window.Echo = (function (window, document, undefined) { }; var _pollImages = function () { - for (var i = 0; i < store.length; i++) { + for (var i = 0, len = store.length; i < len; i++) { var self = store[i]; if (_inView(self)) { self.src = self.getAttribute('data-echo'); - if ([].indexOf && [].slice.call(store).indexOf(self) !== -1) { - [].slice.call(store).splice(i, 1); - } + store.splice(i, 1); } } }; var init = function () { store = document.querySelectorAll('[data-echo]'); + store = [].slice.call(store); _pollImages(); window.onscroll = _pollImages; };