嗨,我有这段 html...
<a href="alcohol_calculator.php" class="swfselector">
» Alcohol unit calculator prototype
<img class="tab" src="/images/1.png" width="30" height="28" alt="1" />
<img class="tab" src="/images/2.png" width="30" height="28" alt="2" />
<img class="tab" src="/images/3.png" width="30" height="28" alt="3" />
<img class="tab" src="/images/5.png" width="30" height="28" alt="5" />
</a>
<a href="bouncing_ball.php" class="swfselector">
» Bouncing ball animation
<img class="tab" src="/images/3.png" width="30" height="28" alt="3" />
</a>
使用 Jquery 我想要它,这样当有人将鼠标悬停在“swfselector”类上时,所有带有类选项卡的子图像都会在其 src 中添加一个“o”...例如(/images/2o.png 或 /images/3 .png/)。
到目前为止我有这个,但它什么也没做,无论如何都会在“.png”之后添加“o”。
$('.swfselector').each.hover(function(){
$(this).find('.tab').attr('src'+'o');
});
帮助表示赞赏。