jquery.pngFix.js 使页面冻结
我正在使用 jquery.pngFix.js 来修复 png 的 IE6 透明度。我按照以下方式将其拉到标题处,然后在单独的 .js 文件中调用该函数:
<!--[if IE 6]>
<script src="/js/jquery.pngFix.js" language="javascript" type="text/javascript"></script>
<![endif]-->
但我的页面有时会在 IE6 中冻结,就像它无法加载某些内容一样,但没有错误,也没有丢失任何内容,尽管如果我禁用jquery.pngFix.js 问题就消失了。有没有人遇到过该插件的此类问题?
我现在能想到的唯一解决方案是将插件放在页面底部,等待页面加载,它似乎对我有用,但我想知道是否有更好的方法来做到这一点?
<script src="/js/jquery.pngFix.js" language="javascript" type="text/javascript"></script>
<script>jQuery(function(){if ($().pngFix) {$(document).pngFix();}});</script>
谢谢。
I am using jquery.pngFix.js to fix IE6 transparency for png. I am pulling it at the header the following way and then calling the function in separate .js file:
<!--[if IE 6]>
<script src="/js/jquery.pngFix.js" language="javascript" type="text/javascript"></script>
<![endif]-->
but my page just gets frozen in IE6 sometimes, like it cant load something but there is no errors and nothing is missing although if i disable the jquery.pngFix.js the problem is gone. Has anyone ever met such issue with that plugin?
The only solution i could come up with for now is to place the plugin right at the bottom of the page to wait until the page is loaded and it seems to work for me but i wonder if there is a better way of doing this?
<script src="/js/jquery.pngFix.js" language="javascript" type="text/javascript"></script>
<script>jQuery(function(){if ($().pngFix) {$(document).pngFix();}});</script>
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不管怎样,回到我的问题:)我想出了以下修复:
所以,问题解决了,这将等到整个文档实际加载,然后触发 pngfix。
Anyway getting back to my problem :) I came up with the following fix:
So, issue solved, that will wait till the whole document actually is loaded and then fire the pngfix.