Why does Firefox 3.6 alter jQuery and CSS properties?
Alright, more specifically. I have a crossfade plugin to create a glow effect between two images that are placed on top of each other. The function (posted below) will make the top image transition to an opacity of 0 in 200 ms on hover and transition back to an opacity of 1 in 500 ms on hover-off. My problem is that the original image is not being displayed now within Firefox 3.6.6.
HTML looks like this:
<div id="logout-button">
<img class="fade" src='/img/test/control-logout.jpg' style="background:url(/img/test/control-logout-hover.jpg); border:none;"/>
</div>
CSS looks like this:
#control-bar #logout-button{
float:right;
margin:3px 30px 0 0;
}
#logout-button img.fade{
margin:-1px 0 0 0;
width:33px;
height:22px;
cursor:pointer;
border:none;
}
jQuery functions page looks like this:
$(window).bind('load', function(){
$("img.fade").crossfade();
});
jQuery Crossfade plugin looks like this:
$.fn.crossfade = function(){
return this.each(function(){
var $$ = $(this);
var target = $$.css('backgroundImage').replace(/^url|[\(\)]/g, '');
$$.wrap('<span style="position: relative;"></span>').parent().prepend('<img>').find(':first-child').attr('src', target).css({border:'none'});
if(jQuery.browser.msie){
$$.css({position:'absolute', left:0, top:'0px', border:'none'});
}else{
$$.css({position:'absolute', left:0, top:'-6px', border:'none'});
};
$$.hover(function(){
$$.stop().animate({opacity: 0}, 200);
}, function(){
$$.stop().animate({opacity: 1}, 500);
}, 0);
});
};