我有这样的链接:
<div id="section-1">
<a class="a" href="#">somethig text</a>
<a class="a" href="#">somethig text</a>
<a class="a" href="#">somethig text</a>
<a class="a" href="#">somethig text</a>
<a class="a" href="#">somethig text</a>
</div>
这里是 JQuery:
$('.a').mouseover(function(){
$(".a").animate({height:"100px"},150);
$(".a").mouseout(function(){
$(".a").animate({height:"30px"},150);
});
});
我想在鼠标悬停时为类 a 设置动画,但它为名称为 a 的所有类设置动画,我想为鼠标悬停的 a 设置动画
最佳答案
使用:
$('.a').mouseover(function () {
$(this).animate({ height: "100px" }, 150);
});
$(".a").mouseout(function () {
$(this).animate({ height: "30px" }, 150);
});
关于javascript - 如何选择这个 Jquery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21398282/