我在绑定 mouseover mouseon 事件时遇到问题。
我可以用 off 来解绑它们
$('.overview li a img').off('mouseover mouseon');
但似乎不起作用。
$('.overview li a img').on('mouseover mouseon');
有什么建议么?
我在绑定 mouseover mouseon 事件时遇到问题。
我可以用 off 来解绑它们
$('.overview li a img').off('mouseover mouseon');
但似乎不起作用。
$('.overview li a img').on('mouseover mouseon');
有什么建议么?
没有mouseon
事件。有:
此外,您应该使用处理函数来绑定事件:
$(".overview li a img").on("mouseover", function() {
console.log("Mouse is over");
});
这是每次触发事件时执行的函数。
$('.overview li a img').on({'mouseover mouseenter':function(event){
alert("hello");
}},null,null);
或者
$('.overview li a img').on({'mouseover':function(event){
alert("hello")},
'mouseenter':function(event){
alert("world");
}},null,null);
应该可以工作,因为 .on() 函数需要一个函数来绑定。