jquery.lazyload przestaje sprawdzać scrollTop, jeżeli element nie ma atrybutu 'lazylo...
authorzuber <marek@stepniowski.com>
Sat, 22 Aug 2009 21:11:57 +0000 (23:11 +0200)
committerzuber <marek@stepniowski.com>
Sat, 22 Aug 2009 21:11:57 +0000 (23:11 +0200)
project/static/js/jquery.lazyload.js

index 522250f..c15167b 100644 (file)
@@ -23,6 +23,9 @@
         }
         
         function checkScroll() {
         }
         
         function checkScroll() {
+            if (container.data('lazyload:lastCheckedScrollTop') == undefined) {
+                return;
+            }
             if (Math.abs(container.scrollTop() - container.data('lazyload:lastCheckedScrollTop')) > settings.scrollThreshold) {
                 container.data('lazyload:lastCheckedScrollTop', container.scrollTop());
                 
             if (Math.abs(container.scrollTop() - container.data('lazyload:lastCheckedScrollTop')) > settings.scrollThreshold) {
                 container.data('lazyload:lastCheckedScrollTop', container.scrollTop());