I'm having issues exiting a resize event. I have some operations i want to do whenever the browser window is being resized. However after the resizing event has finished i have some further code that i wan't to be executed. Due to the resizing event not finishing the code that exceeds this event are not being executed.
Is there a way to finalize the event or should the resizing event be implemented in another way? How do i get doMoreStuff() to be executed after the resizing?
Code example:
$(window).resize(function (){
doStuff();
});
doMoreStuff();
You can do it in two ways.
$(window).resize(function() {
doStuff();
doMoreStuff();
});
$(window).resize(function() {
doStuff();
settimeout(function() {
doMoreStuff();
}, 0);
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.