读书人

解决IE中Resize事件重复提交多次的有关

发布时间: 2012-09-23 10:28:11 作者: rapoo

解决IE中Resize事件重复提交多次的问题(转)

最近项目中用到resize事件来控制页面的元素高度,相信这个功能并不少见。当问题就出现了,偶尔发现在IE6下,页面会等待比较久甚至出现假死状态。在DEBUG的过程中发现resize事件触发后,被重复执行了多次。在网上搜索了一下解决方案,分享下这个比较不错的解决办法。

?

PS:若项目是使用到jQuery的话,可以最大限度的降低工作量了。

?

-----------------------------以下是转载内容

?

?

作者:Andrea Ercolino

In IE the window resize event is fired multiple times per actual resize: it is a well known issue for IE6 and IE7, but they misbehave along different patterns. Actually it seems that IE6 is worse than IE7.

After quite a long session of R&D, I've got to a pretty good solution, in the form of a jQuery plugin:

jquery.wresize.js(作者网站的原插件地址在此)。

?

?

?

?

读书人网 >Web前端

热点推荐