/* smartscroll: debounced scroll event for jQuery * https://github.com/lukeshumard/smartscroll * Copyright 2011 Louis-Remi & Luke Shumard * Licensed under the MIT license. */ (function(g,a,h){var b=a.event,c;b.special.smartscroll={setup:function(){a(this).bind("scroll",b.special.smartscroll.handler)},teardown:function(){a(this).unbind("scroll",b.special.smartscroll.handler)},handler:function(d,b){var e=this,f=arguments;d.type="smartscroll";c&&clearTimeout(c);c=setTimeout(function(){a(e).trigger("smartscroll",f)},"execAsap"===b?0:100)}};a.fn.smartscroll=function(a){return a?this.bind("smartscroll",a):this.trigger("smartscroll",["execAsap"])}})(window,jQuery);