开发者

DD_belatedPNG images disappear after document ready

开发者 https://www.devze.com 2023-01-23 11:39 出处:网络
I\'m using DD_belatedPNG to fix transparent PNGs in IE6; at a certain point I noticed that all fixed PNGs started disappearing a second after the document loaded. Something along these lines: page loa

I'm using DD_belatedPNG to fix transparent PNGs in IE6; at a certain point I noticed that all fixed PNGs started disappearing a second after the document loaded. Something along these lines: page loads, 1 second passes, the transparency becomes viewable and the PNGs almost immediately 开发者_运维问答disappear. Any clue on what the cause is and how to fix? Thanks!

UPDATE: the elements are still in place, so if one of the PNGs was a link, it is still clickable.

<script src="/scripts/plugins/DD_belatedPNG_0.0.7a-min.js"></script>
<script>
    PNG_selectors = ".bbb, #logo, #home_title, .home-image, ..........";
    alert("PNGs are going to disappear now");
    DD_belatedPNG.fix(PNG_selectors);
</script>

As long as the alert is in place they are there, once OK is clicked, they are gone.


For those who are interested, this was being caused by as script loading stuff from fonts.com... I set it to defer, and it fixed the issue. Sweet!


Can you try calling DD_belatedPNG.fix() only when the page has finished loading, then see if the problem goes away? Attach an event handler to window.onload like so:

<script>
window.onload = function() {
    var PNG_selectors = ".bbb, #logo, #home_title, .home-image, ..........";
    alert("PNGs are going to disappear now");
    DD_belatedPNG.fix(PNG_selectors);
};
</script>
0

精彩评论

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