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.

2 lines
469 B

/* jquery.onvisible.js v0.1 | (c) @ajlkn | MIT licensed */
(function(){var e,t=jQuery(window),n=[],r=100,i=150,s=function(){var e=n.length,r=t.scrollTop()+t.height()-i,s,o;for(s=0;s<e;s++)o=n[s],!o.state&&r>o.o.offset().top&&(o.state=!0,o.fn())};t.load(function(){t.on("scroll resize",function(){window.clearTimeout(e),e=window.setTimeout(function(){s()},r)}).trigger("resize")}),jQuery.fn.onVisible=function(e,t){n.push({o:jQuery(this),fn:e,pad:t?t:i,state:!1})}})();