爲什麼Firefox 3.6會改變jQuery和CSS屬性?Firefox 3.6爲什麼改變jQuery和CSS屬性?
好的,更具體一點。我有一個交叉淡入淡出插件,用於在兩個放在彼此頂部的圖像之間創建發光效果。該功能(在下面發佈)將使頂部圖像在懸停時在200毫秒內轉變爲0的不透明度,並在懸停關閉時在500毫秒內轉換回不透明度爲1。我的問題是,現在Firefox 3.6.6中沒有顯示原始圖像。
HTML看起來像這樣:
<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是這樣的:
#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的功能頁面看起來是這樣的:
$(window).bind('load', function(){
$("img.fade").crossfade();
});
jQuery的淡入淡出插件看起來是這樣的:
$.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);
});
};
請添加更多細節!像什麼東西應該看起來像什麼,它看起來像什麼!你是什麼意思的jQuery屬性?!? – jigfox 2010-07-13 15:02:25
你有什麼意思嗎? – 2010-07-13 15:02:31
大聲笑!...我以爲IE6是威脅...... :) – Reigel 2010-07-13 15:10:16