//# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- // //# SCROLLEND (function($) { var $event = $.event, $special, resizeTimeout; $special = $event.special.scrollend = { setup: function() { $( this ).on( "scroll", $special.handler ); }, teardown: function() { $( this ).off( "scroll", $special.handler ); }, handler: function( event, execAsap ) { // Save the context var context = this, args = arguments, dispatch = function() { // set correct event type event.type = "scrollend"; $event.dispatch.apply( context, args ); }; if ( resizeTimeout ) { clearTimeout( resizeTimeout ); } execAsap ? dispatch() : resizeTimeout = setTimeout( dispatch, $special.threshold ); }, threshold: 150 }; })(jQuery);