gpt4 book ai didi

jquery - 谁能告诉我为什么这个动画不起作用?

转载 作者:行者123 更新时间:2023-12-01 06:51:50 25 4
gpt4 key购买 nike

我无法使 display: blockspan 上工作。

$(".wishlistbtn, .compareboxbtn").hover(
function() { $(this).children(".helppopup").show(); },
function() { $(this).children(".helppopup").hide(); }
);

带有标记:

<ul>
<li class="wishlistbtn"><a href="#">Wishlist <span class="helppopup">Add to my Wishlist<img src="images/helppopup-arrow.png" alt=""></span></a></li>
<li class="compareboxbtn"><a href="#">Compare <span class="helppopup">Add to compare box<img src="images/helppopup-arrow.png" alt=""></span></a></li>
<li class="getquotebtn"><a href="#">Get Quote</a></li>
</ul>

它根本不起作用,但同样的技术在其他地方也有效。

最佳答案

使用 find 而不是 children,因为 .hellpopup 元素不是直接子元素:

$(".wishlistbtn, .compareboxbtn").hover(
function() { $(this).find(".helppopup").show(); },
function() { $(this).find(".helppopup").hide(); }
);

(ugly) Demonstration

关于jquery - 谁能告诉我为什么这个动画不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13864500/

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