Skip to content
Simple jQuery plugin designed to emulate an 'after resize' event
JavaScript
Find file
Pull request Compare This branch is 2 commits ahead of mcshaman:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README.md
afterresize.js
afterresize.min.js
bower.json
demo.js
index.html

README.md

afterResize.js

If you have ever used jQuery's .resize() method to detect a window resize you may be aware that most browsers don't wait for the resize event to finish before it triggers a callback. Instead the event and it's callback is fired rapidly until the resize is complete.

This very simple jQuery plugin is designed to emulate an 'after resize' event. It works by adding the callback to a queue to be executed after a duration. If the event is triggered again before the end of this duration, it is restarted and the callback will not execute until the duration can finish.

Example

$(document).ready( function() {
    $(window).afterResize( function() {
        alert('Resize event has finished');
    }, true, 100 );
});

Licence

Do with it what you wish.

Something went wrong with that request. Please try again.