forked from aFarkas/lazysizes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ls.scrollintent.min.js
3 lines (3 loc) · 1017 Bytes
/
ls.scrollintent.min.js
1
2
3
/*! lazysizes - v1.0.0-pre - 2015-02-23
Licensed MIT */
!function(a,b){"use strict";var c,d;if(a.addEventListener){if(c=a.lazySizes&&lazySizes.cfg||a.lazySizesConfig,d=0,c||(c={},a.lazySizesConfig=c),a.lazySizes&&lazySizes.init.i)return;c.scroll=!1,c.expand||(c.expand=250),"scrollLoadMode"in c||(c.scrollLoadMode=1),addEventListener("scroll",function(){var e,f,g,h,i,j=function(){var a=Math.abs(h-(f.scrollTop||f.pageYOffset||0)),b=Math.abs(i-(f.scrollLeft||f.pageXOffset||0));f=null,400>a&&400>b&&(lazySizes.loader.m<2&&(lazySizes.loader.m=2),180>a&&180>b&&l())},k=function(){lazySizes.loader.m=3,d=0,l(),clearTimeout(e)},l=function(){lazySizes.loader.checkElems(),clearTimeout(g),f=null};return function(m){var n=m.target==b?a:m.target;clearTimeout(e),e=setTimeout(k,99),lazySizes.loader.m=c.scrollLoadMode,0===d?lazySizes.loader.checkElems():d>40&&(d=-1),d++,f?n!=f&&l():(f=n,h=f.scrollTop||f.pageYOffset||0,i=f.scrollLeft||f.pageXOffset||0,clearTimeout(g),g=setTimeout(j,150)),n=null}}(),!0)}}(window,document);