Simple resize control special event plugin for jQuery.
This is how you bind resize start event:
jQuery(window).on('resizestart', function () {
console.log('resize started!');
});
This is how you bind resize stop event:
jQuery(window).on('resizestop', function () {
console.log('resize stopped!');
});
The second parameter sets the sensivity of start/stop event. Lesser value is higher. Default is 300 for event start, 200 for event stop.
jQuery(window).on('resizestop', 100, function () {
console.log('resize stopped!');
});
That will work more slowly.
jQuery(window).on('resizestop', 1000, function () {
console.log('resize stopped!');
});
jQuery(window).on('resizestop resizestart', function (e) {
console.log(e.type); // e.type will return "resizestart" or "resizestop"
});
You can use resizestart
and resizestop
instead of using on
binding.
jQuery(window).resizestart(function (e) {
console.log('resize started');
});
jQuery(window).resizestop(function (e) {
console.log('resize stopped');
});
jQuery(window).resizestop(1000, function (e) {
console.log('resize stopped'); // will work 1000ms delayed.
});
License is CC0, means it is published to the public domain. You can use it for free wherever/whenever you want.