i want to initiate a function when user finishes resizing of his browser window. please suggest how to do in either pure JS or jquery.
Note: i want to raise the event only once and after user has done browser resizing.
i want to initiate a function when user finishes resizing of his browser window. please suggest how to do in either pure JS or jquery.
Note: i want to raise the event only once and after user has done browser resizing.
From the docs:
$(window).resize(function() {
$('#log').append('<div>Handler for .resize() called.</div>');
});
You can introduce a small delay before running the resize handler using setTimeout
and keep renewing this timeout until the events stop. This article explains how to do it - http://ajaxian.com/archives/delaying-javascript-execution