How can I make it so that each time when user changes the window size, the page perform a function?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The following function should do what you need, it works on all browsers (with the single exception of not firing when Safari is NOT maximized and resolution changes)
It fires upon window re-sizing as well as resolution change and also has a delay to avoid multiple calls while the user is re-sizing the window.
Testing jsFiddle