我想要一張圖像表,當您將鼠標懸停在每張圖像上時,它會爲其不透明度設置動畫。問題在於它只會增加FIRST圖像的不透明度,其餘不會受到影響。jquery animate opacity not in table
HTML:
<table id="pictures" align="center">
<tr>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
</tr>
<tr>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
</tr>
<tr>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
<td><img id="pics" src="img/post/shy_artwork.jpg"></img></td>
</tr>
</table>
的jQuery:
$("#pics").hover(function() {
$(this).stop().animate({opacity : 1, border : '17px rgba(255, 255, 255, 0.2) solid'}, 300);
}, function() {
$(this).stop().animate({opacity : 0.85, border : '17px rgba(255, 255, 255, 0) solid'}, 300);
});
CSS:
img#pics
{
height:150px;
width:150px;
opacity:0.85;
border:17px rgba(255, 255, 255, 0) solid;
}
我怎樣才能得到這個工作?謝謝你的幫助。
啊!我知道這很簡單。謝謝。 :) – amoeba