开发者

jquery.pngFix.js is making page frozen

开发者 https://www.devze.com 2023-02-11 01:41 出处:网络
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:

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.


Anyway getting back to my problem :) I came up with the following fix:

$(window).load(function(){
        //Png fix.
        if ($().pngFix) {
            $(document).pngFix();
        }   
});

So, issue solved, that will wait till the whole document actually is loaded and then fire the pngfix.

0

精彩评论

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