gpt4 book ai didi

jquery .on() 似乎不起作用

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

我正在研究轨道模拟,我只是想向 mouseenter 和 mouseexit 事件添加一些用户交互。您可以看到一个工作示例 here .

我的 on 语句是:

$('.planet').on({
'mouseenter': function() {
pauseAnimation = true;
},
'mouseleave': function () {
pauseAnimation = false;
},
'click' : function () {
alert('click');
}
});

但似乎没有任何事件被触发。如果重要的话,我正在 Mac 上使用最新的 Chrome。

最佳答案

这是一个 z-index 问题。将 z-index: 1; 添加到 .planet css 部分。之后 fiddle 工作正常:http://jsfiddle.net/Pe87m/9/

关于jquery .on() 似乎不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10729791/

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