为什么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