mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed some lazyload and minified some scripts
This commit is contained in:
73
static/dist/lib/jquery.scrollstop.js
vendored
Normal file → Executable file
73
static/dist/lib/jquery.scrollstop.js
vendored
Normal file → Executable file
@@ -1,72 +1 @@
|
||||
/* http://james.padolsey.com/javascript/special-scroll-events-for-jquery/ */
|
||||
|
||||
(function(){
|
||||
|
||||
var special = jQuery.event.special,
|
||||
uid1 = "D" + (+new Date()),
|
||||
uid2 = "D" + (+new Date() + 1);
|
||||
|
||||
special.scrollstart = {
|
||||
setup: function() {
|
||||
|
||||
var timer,
|
||||
handler = function(evt) {
|
||||
|
||||
var _self = this,
|
||||
_args = arguments;
|
||||
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
} else {
|
||||
evt.type = "scrollstart";
|
||||
jQuery.event.dispatch.apply(_self, _args);
|
||||
}
|
||||
|
||||
timer = setTimeout( function(){
|
||||
timer = null;
|
||||
}, special.scrollstop.latency);
|
||||
|
||||
};
|
||||
|
||||
jQuery(this).bind("scroll", handler).data(uid1, handler);
|
||||
|
||||
},
|
||||
teardown: function(){
|
||||
jQuery(this).unbind( "scroll", jQuery(this).data(uid1) );
|
||||
}
|
||||
};
|
||||
|
||||
special.scrollstop = {
|
||||
latency: 300,
|
||||
setup: function() {
|
||||
|
||||
var timer,
|
||||
handler = function(evt) {
|
||||
|
||||
var _self = this,
|
||||
_args = arguments;
|
||||
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
|
||||
timer = setTimeout( function(){
|
||||
|
||||
timer = null;
|
||||
evt.type = "scrollstop";
|
||||
jQuery.event.dispatch.apply(_self, _args);
|
||||
|
||||
|
||||
}, special.scrollstop.latency);
|
||||
|
||||
};
|
||||
|
||||
jQuery(this).bind("scroll", handler).data(uid2, handler);
|
||||
|
||||
},
|
||||
teardown: function() {
|
||||
jQuery(this).unbind( "scroll", jQuery(this).data(uid2) );
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
!function(){var a=jQuery.event.special,b="D"+ +new Date,c="D"+(+new Date+1);a.scrollstart={setup:function(){var c,d=function(b){var d=this,e=arguments;c?clearTimeout(c):(b.type="scrollstart",jQuery.event.dispatch.apply(d,e)),c=setTimeout(function(){c=null},a.scrollstop.latency)};jQuery(this).bind("scroll",d).data(b,d)},teardown:function(){jQuery(this).unbind("scroll",jQuery(this).data(b))}},a.scrollstop={latency:300,setup:function(){var b,d=function(c){var d=this,e=arguments;b&&clearTimeout(b),b=setTimeout(function(){b=null,c.type="scrollstop",jQuery.event.dispatch.apply(d,e)},a.scrollstop.latency)};jQuery(this).bind("scroll",d).data(c,d)},teardown:function(){jQuery(this).unbind("scroll",jQuery(this).data(c))}}}();
|
||||
Reference in New Issue
Block a user