From 359c42987bbf24cb6926394a7551d26c62d25559 Mon Sep 17 00:00:00 2001 From: onlyurei Date: Wed, 4 Dec 2013 14:45:39 -0600 Subject: [PATCH] Add window.onresize event handler. Window resize can cause previously folded images to be visible (e.g. increase the width or height of the browser window), the lazy loading handler should be attached to this event as well. --- src/echo.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/echo.js b/src/echo.js index 9f15708..a7e8cbc 100644 --- a/src/echo.js +++ b/src/echo.js @@ -38,8 +38,10 @@ window.Echo = (function (window, document, undefined) { if (document.addEventListener) { window.addEventListener('scroll', _throttle, false); + window.addEventListener('resize', _throttle, false); } else { window.attachEvent('onscroll', _throttle); + window.attachEvent('onresize', _throttle); } };