Check out http://www.bridgeland.com.
Instead of using the PNG as an IMG tag I used a div with a filter in order to make the PNG look clean and not aliased.
I wrapped that filter div with another which I use to apply my opacity fade. On the completion callback of the fade I replace the wrapper div (and PNG div contained) with a normal IMG tag PNG. This one is vanilla and hasn't had any filters applied to it so it looks completely clean. I use an IE6 PNG fix on this IMG as well so it will load in properly.
Here is the HTML code:
Code:
<div id="water">
<!--[if lt IE 7]>
<div class="boat iealphaboat">
<div style="display:block;width:664px;height:340px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src=/images/stories/rotator/boat.png);"></div>
</div>
<img src="/images/stories/rotator/boat.png" class="png-fix ieboat" />
<![endif]-->
<!--[if gt IE 6]>
<div class="boat iealphaboat">
<div style="display:block;width:664px;height:340px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src=/images/stories/rotator/boat.png);"></div>
</div>
<img src="/images/stories/rotator/boat.png" class="png-fix ieboat" />
<![endif]-->
<![if !IE]>
<img src="/images/stories/rotator/boat.png" class="boat" />
<![endif]>
</div>
Here is the Javascript:
Code:
jQuery(function(){
jQuery('.boat').css('opacity', 0);
jQuery('.boat').show();
});
jQuery(window).load(function () {
jQuery('.boat').animate({
top: '-=210',
opacity: '1'
}, 6000, 'easeOutQuint', function() {
jQuery('.iealphaboat').hide();
jQuery('.ieboat').show();
});
});
Here is the CSS:
Code:
.boat, .ieboat {position:absolute;width:664px;height:340px;top:256px;left:150px;display:none;}
.ieboat {display:none;top:46px;}
#water{position:relative;height:350px;width:932px;background:black;overflow:hidden;background: url(/images/stories/rotator/water.jpg);}
Hopefully this will help a few people out that run into this problem!
-Matthew
Bookmarks