From 3753d161a1a7187b107c8576079f31bafa8c9333 Mon Sep 17 00:00:00 2001 From: Arnaud JAEGERS Date: Wed, 3 Sep 2014 10:14:23 +0200 Subject: [PATCH] Add option 'container' to support other containers than default window - fix --- src/echo.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/echo.js b/src/echo.js index 95a46bf..f886846 100644 --- a/src/echo.js +++ b/src/echo.js @@ -55,11 +55,11 @@ container = opts.container || root; echo.render(); if (document.addEventListener) { - root.addEventListener('scroll', debounceOrThrottle, false); - root.addEventListener('load', debounceOrThrottle, false); + container.addEventListener('scroll', debounceOrThrottle, false); + container.addEventListener('load', debounceOrThrottle, false); } else { - root.attachEvent('onscroll', debounceOrThrottle); - root.attachEvent('onload', debounceOrThrottle); + container.attachEvent('onscroll', debounceOrThrottle); + container.attachEvent('onload', debounceOrThrottle); } };