这里是我的代码:为什么.not()没有任何影响?
$('body').not('.specific_element').css('opacity','.3');
body{
border: 1px solid;
}
.specific_element{
border: 1px solid red;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p>There are some texts</p>
<div class="specific_element">
sth
</div>
<p>whatever</p>
所有我想要做的就是保证它们有一个红色的边框1
元素的不透明度。我的意思是我想在除特定元素之外的所有内容上应用opacity: .3
。我怎样才能做到这一点?
特定元素为人体内部,你对身体施加的不透明度。所以即使排除一个元素,身体内部的所有元素都将不透明,因为该元素仍在体内 – guradio
@guradio那里'.not()'的工作是什么? – stack
因此,即使您排除一个元素,因为该元素仍在体内,所有身体内部的所有内容都将具有不透明性 – guradio