开发者

OnResize Event for all browsers?

I was wondering if there was to fire an event upon the resizing of the window that would work for all browsers. Any help would be appreciated.

Th开发者_如何转开发anks in advance.


jQuery, as usual, has a cross-browser resize event.


This should answer your question:

<script type="text/javascript">
    window.onresize = function () {
       <!-- YOUR CODE WILL GO HEAR -->
    }
</script>


You can try document.body.onresize=function(){//your code}.

I don't have opera. I have tested this on IE 9 and chrome.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜