我想要一张图片表,当您将鼠标悬停在每张图片上时,它将为其不透明度设置动画。问题是它只会在第一张图像上设置不透明度动画,其余的不会受到影响。
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;
}
我怎样才能让它工作?谢谢你的帮助。