gpt4 book ai didi

jquery - mouseenter 和 mouseleave 在 jquery 中不起作用

转载 作者:行者123 更新时间:2023-12-01 06:45:52 26 4
gpt4 key购买 nike

我正在测试我的网站,添加一些 jQuery 交互。我创建了这个脚本:

$(document).ready(function() {
$('.flash').on({
mouseenter: function (
$('.flash').hide();
},
mouseleave: function {
$('.flashOn').show();
}
});

非常简单地闪光:http://www.paolobergomi.it/sitob/index.html但实际上我不知道为什么不起作用。我调试了很多,但都是一样的。 div 正确地放置在 HTML 中,如您所见,脚本没问题(我认为),但它不起作用,欢迎提供任何线索。

最佳答案

当您使用正确的语法时,

mouseentermouseleave 在 jQuery 中工作正常:

$('.flash').on({
mouseenter: function() {
$('.flashOn').hide();
},
mouseleave: function() {
$('.flashOn').show();
}
});

Example fiddle

我还假设 mouseenter 处理程序应该隐藏 .flashOn 元素?

关于jquery - mouseenter 和 mouseleave 在 jquery 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27770018/

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