在function()函數中,什么時候需要在()中加e,什么時候不用加e,有沒有什么標準???
在function()函數中,什么時候需要在()中加e,什么時候不用加e,有沒有什么標準啊?
$(".aaron1").mousemove(function(e) {
? ? ? ? $(this).find('p:last').html('移動的X位置:' + e.pageX)
? ? })
在function()函數中,什么時候需要在()中加e,什么時候不用加e,有沒有什么標準啊?
$(".aaron1").mousemove(function(e) {
? ? ? ? $(this).find('p:last').html('移動的X位置:' + e.pageX)
? ? })
2019-08-28
舉報
2020-02-21
不加e這個參數用this不是一樣的嗎??
2019-10-14
有點懂了,看來得多練習項目了
2019-09-02
我的理解是 這里的e跟原聲js里面的event一樣?
var btn = document.creatElement('Button')
btn.onmousemove = function(event){
? event = event || window.event
//比如你要獲取鼠標當前的坐標,就要用到這個event
var X= event.offsetLef+"px"
var Y = event.offsetTop + "px"
console.log(X,Y)
}
2019-09-02
e是事件對象,當用到事件對象的時候加e,不用的時候可加可不加