开发者

Notification of browser size change?

Is it possible to get notified when the browser window size changes? This might happen when the user resizes the brow开发者_如何转开发ser 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜