- event.type:返回事件类型;
- event.data:返回参数中传入的data值;
- $(this):指向触发事件的对象;
贴段代码:
var events = { 'mouseenter': function(e){//注意,必须传e进来,不然会报错 console.log('I am mouseenter function') }, 'mouseleave': function(e){ console.log('I am mouseleave function') }, 'click': function(e){ console.log($(this)) console.log(e.data) } } $('.myul').delegate('.myli div',events,'hahah');
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/175777.html原文链接:https://javaforall.net
