You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
715 B
1 lines
715 B
!function(a){a.fn.scrollLoading=function(b){var c={attr:"data-url",container:a(window),callback:a.noop},d=a.extend({},c,b||{});d.cache=[],a(this).each(function(){var b=this.nodeName.toLowerCase(),c=a(this).attr(d.attr),e={obj:a(this),tag:b,url:c};d.cache.push(e)});var e=function(b){a.isFunction(d.callback)&&d.callback.call(b.get(0))},f=function(){var b=d.container.height();a(window).get(0)===window?contop=a(window).scrollTop():contop=d.container.offset().top,a.each(d.cache,function(a,c){var d,f,g=c.obj,h=c.tag,i=c.url;g&&(d=g.offset().top-contop,d+g.height(),(d>=0&&b>d||f>0&&b>=f)&&(i?"img"===h?e(g.attr("src",i)):g.load(i,{},function(){e(g)}):e(g),c.obj=null))})};f(),d.container.bind("scroll",f)}}(jQuery);
|