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.
精彩评论