jquery - 事件是火,如果我添加类
问题描述
如果我添加类...
$(".cart").addClass("show_cart");
...它触发 mouseenter 而不是 mouseleave 事件
$(document).on({
mouseenter: function () {
....
},
mouseleave: function () {
....
}
}, '.show_cart');
我究竟做错了什么?为什么会触发事件?只有当我将鼠标移到元素上时,我才想触发事件 mouseenter。
解决方案
推荐阅读
- swift - 一旦事件日期过去,获取在 TableViewControllers 之间传递的信息 - Swift
- c# - 如何解决编码问题阅读提要
- python - 在 Python 中获取特定数组值的简单方法是什么?
- python - Python Zelle 图形和 While 循环
- gradle - 根据先前任务的输出生成多个 Gradle Tar 任务
- swift - locationManager.startUpdatingLocationWithCompletionHandler 未收到完成
- r - 将货币字符串转换为 R 中的数字
- game-maker - 2D 数组未正确访问 globalvar (GameMaker)
- php - 如何在wordpress中包含内部联系表格7电子邮件
- java - 如何映射列表
在没有额外连接表的情况下使用 Hibernate/JPA?