事件中$(this)指向window的问题

##this指向window
箭头函数事件中 ( t h i s ) w i n d o w f u n c t i o n ( e ) (this)总是指向window,函数中function(e){}传事件形参, (this)也是指向window,如果要阻止默认事件等用到这个e,事件在两个函数中写,需要$(this)的单独一个事件函数中写。

猜你喜欢

转载自blog.csdn.net/weixin_44022586/article/details/88695093