在jQuery中绑定多个事件名称是,使用空格隔开,举例如下:
$("#foo").bind("mouseenter mouseleave", function() {
$(this).toggleClass("entered");
});在1.4版本以后,也可以如下绑定
$("#foo").bind({
click: function() {
// do something on click
},
mouseenter: function() {
// do something on mouseenter
}
});
Copyright © 2019- baoaiwan.cn 版权所有 赣ICP备2024042794号-3
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务