Is it possible to get notified when the browser window size changes? This might happen when the user resizes the browser window etc. I need to resize an element in response to size change,
Thanks
Is it possible to get notified when the browser window size changes? This might happen when the user resizes the browser window etc. I need to resize an element in response to size change,
Thanks
Yes: http://api.jquery.com/resize/
but the event fires crazily. Use this instead (second example down):
http://benalman.com/code/projects/jquery-dotimeout/examples/debouncing/
When resizing the window, the resize
event will trigger at every interval, instead of triggering only when the resize
event is finished. Use debouncing to ensure that it doesn't fire at every interval.