gpt4 book ai didi

javascript - 如何选择这个 Jquery

转载 作者:行者123 更新时间:2023-11-30 07:02:18 25 4
gpt4 key购买 nike

我有这样的链接:

<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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com