日期:2014-05-16  浏览次数:20400 次

和火狐的兼容问题
<script type="text/javascript" src="jquery.js"></script>
<script> 
$(document).ready(function(){  
$("#b").click(function(){ 
$("#over").fadeIn(); 
$("#bg").css("background","#ccc"); 
$("#bg").css("opacity","0.8"); 
}); 
$("#close").click(function(){ 
$("#over").fadeOut(); 
$("#bg").css("background","#fff"); 
$("#bg").css("opacity","1"); 
}); 
}); 
</script>
刚学的jquery
在ie里只有"#bg"也就是背景色会变暗
但在火狐里"#over"和"#bg"一块变暗,
求各位帮助小弟下。

------解决方案--------------------
你说的是title和content的背景变成灰色了吧?可能浏览器版本问题,我试不出来,你试下覆盖下面两个CSS看看
#title{
border: 1px solid #1840C4;
background: #95B4DC !important;
padding: 2px;
font-size:14px;
cursor: default;
}

#content{
width:500px;
height:400px;
border:1px solid #C2D560;
background: #EFF4D7 !important;
}

------解决方案--------------------
fadeIn()和fadeOut()都是延时执行的方法,一般不能同时使用。
一般可以写为$(this).fadeIn().siblings().hide()