PageSourceSearch

https://dprg.de/html/js/010_jquery.debouncedresize.js

js dprg.de collected 2026-10-02 10:52:22 UTC 1,174 bytes, 52 lines download raw bytes

1/*
2 * debouncedresize: special jQuery event that happens once after a window resize
3 *
4 * latest version and complete README available on Github:
5 * https://github.com/louisremi/jquery-smartresize
6 *
7 * Copyright 2012 @louis_remi
8 * Licensed under the MIT license.
9 *
10 * This saved you an hour of work? 
11 * Send me music http://www.amazon.co.uk/wishlist/HNTU0468LQON
12 */
13/*
14$(window).on("debouncedresize", function( event ) {
15    // Your event handler code goes here.
16});
17 */
18(function($) {
19
20var $event = $.event,
21	$special,
22	resizeTimeout;
23
24$special = $event.special.debouncedresize = {
25	setup: function() {
26		$( this ).on( "resize", $special.handler );
27	},
28	teardown: function() {
29		$( this ).off( "resize", $special.handler );
30	},
31	handler: function( event, execAsap ) {
32		// Save the context
33		var context = this,
34			args = arguments,
35			dispatch = function() {
36				// set correct event type
37				event.type = "debouncedresize";
38				$event.dispatch.apply( context, args );
39			};
40
41		if ( resizeTimeout ) {
42			clearTimeout( resizeTimeout );
43		}
44
45		execAsap ?
46			dispatch() :
47			resizeTimeout = setTimeout( dispatch, $special.threshold );
48	},
49	threshold: 150
50};
51
52})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.