Last active
August 29, 2015 14:05
-
-
Save forsvunnet/7a774e9494a4fc1aa353 to your computer and use it in GitHub Desktop.
Equalise usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery Closure mode | |
(function($){ | |
// Resizing the propper way | |
var resize = function() { | |
$('element').equalise(); | |
}; | |
$(window) | |
.ready( resize ) | |
.load( resize ) | |
.resize( function() { | |
// Use waitForFinalEvent for improved performance | |
// See http://stackoverflow.com/questions/2854407/javascript-jquery-window-resize-how-to-fire-after-the-resize-is-completed#answer-4541963 | |
// waitForFinalEvent( callback, milliseconds, 'unique-id' ); | |
waitForFinalEvent( resize, 50, 'resize-01' ); | |
} ); | |
setTimeout( resize, 2000 ); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to call this to make waitForFinalEvent to work