gpt4 book ai didi

Jquery点击触发两个 "events"

转载 作者:行者123 更新时间:2023-12-01 06:29:27 24 4
gpt4 key购买 nike

我想要的很简单,但我在语法上遇到了困难。当我的元素单击时,我希望在 .css() 之后触发我的动画。预先感谢您的帮助。干杯。马克。

$('.content').click(function() {
$('#contentWrapper').animate({
"left": "-=475px"}, "fast"),
$(this).prev().css("display": "none");
});

最佳答案

差不多了。您需要在 animate 上传递 complete 参数函数引用:

$('.content').click(function() {
$('#contentWrapper').animate({
"left": "-=475px"}, "fast", function () {
$(this).prev().css("display", "none");
}
);
});

(此外,css 的语法有点不对,您需要 , 而不是 :)

关于Jquery点击触发两个 "events",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9004612/

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