第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

DOM2事件添加再刪除怎么行不通呀,DOM0就行?

DOM2事件添加再刪除怎么行不通呀,DOM0就行?

慕粉4076523 2016-12-25 14:20:53
?????//?添加事件監(jiān)聽(tīng) ?????function?addEvent(ele,type,handler){ ??????if(ele.addEventListener){console.log('1') ????????ele.addEventListener(type,handler,false); ??????} ??????else?if(ele.attachEvent){console.log('2') ????????ele.attachEvent('on'+type,handler); ??????}else{console.log('3') ????????ele['on'+type]=handler; ??????} ????} ????//?刪除事件監(jiān)聽(tīng) ????function?removeEvent(ele,type,handler){ ??????if(ele.removeEventListener){console.log('-1') ????????ele.removeEventListener(type,handler,false); ??????} ??????else?if(ele.detachEvent){console.log('-2') ????????ele.detachEvent('on'+type,handler); ??????}else{console.log('-3') ????????ele['on'+type]=handler; ??????} ????} ?????//DOM2級(jí)添加事件 ??????addEvent(drag,'mousedown',function(){ ????????xPanel=event.clientX-panel.offsetLeft; ????????yPanel=event.clientY-panel.offsetTop; ????????addEvent(document,'mousemove',function(event){ ????????dragPanel(event,xPanel,yPanel); ????????}) ????????addEvent(document,'mouseup',function(){ ??????????removeEvent(document,'mousemove',null); ??????????removeEvent(document,'mouseup',null); ????????}) })//DOM0級(jí)的 ???function?dragDown(){ ??????xPanel=event.clientX-panel.offsetLeft; ??????yPanel=event.clientY-panel.offsetTop; ??????document.onmousemove=function(event){ ????????dragPanel(event,xPanel,yPanel); ??????} ??????//?釋放鼠標(biāo) ??????document.onmouseup=function(){ ????????document.onmousemove=null; ????????document.onmouseup=null; ??????} ????}
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 1436 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)