문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top