当您将鼠标悬停在图像上时,我正在尝试删除我拥有的 CSS 不透明度转换规则。单击项目后如何消除这种情况。
JSFIDDLE HTML
<ul id="grid">
<li><div class="title"></div><a href="#"class="zoom"><img src="1.jpg"><span></span></a></li>
<li><div class="title"></div><a href="#" class="zoom" ><img src="2.jpg"><span></span></a></li>
<li><div class="title"></div><a href="#" class="zoom"><img src="3.jpg"><span></span></a></li>
<li><div class="title"></div><a href="#" class="zoom"><img src="4.jpg"><span></span></a></li>
<li><div class="title"></div><a href="#" class="zoom"><img src="5.jpg"><span></span></a></li>
<li><div class="title"></div><a href="#" class="zoom"><img src="6.jpg"><span></span></a></li>
<li><div class="title"></div><a href="#" class="zoom"><img src="7.jpg"><span></span></a></li>
<li><div class="title"></div><a href="#" class="zoom"><img src="8.jpg"><span></span></a></li>
<li><div class="title"></div><a href="#" class="zoom" ><img src="9.jpg"><span></span></a></li>
</ul>
<div id="hidden"></div>
单击鼠标后我要删除的 CSS
#grid li a:hover img {
-webkit-transition: opacity .2s ease-in;
-moz-transition: opactiy .2s ease-in;
-ms-transition: opacity .2s ease-in;
-o-transition: opacity .2s ease-in;
transition: opacity .2s ease-in;
opacity: 1;
}
#grid:hover li {
-webkit-transition: opacity .2s ease-in;
-moz-transition: opactiy .2s ease-in;
-ms-transition: opacity .2s ease-in;
-o-transition: opacity .2s ease-in;
transition: opacity .2s ease-in;
zoom: 1;
filter: alpha(opacity=100);
opacity: 0.3;
}
我会在 jquery 中做类似(见下文)的事情吗?
$(this).removeClass('grid');