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

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么的disY有錯呢?

//在控制臺輸出a.js:85?Uncaught?ReferenceError:?disY?is?not?defined
????at?HTMLDocument.document.onmouseover?,但也disY也沒在onmouseover下,它是在
onmousemove的函數(shù)中定義的


function?fnDown(e)?{??????????????????????
????e?=?e?||?window.event;
????var?oDarg?=?document.getElementById('loginPanel'),
????????ow?=?oDarg.offsetLeft,
????????oh?=?oDarg.offsetTop,
????????ew?=?e.clientX,
????????eh?=?e.clientY,
????????disX?=?ew?-?ow,?????????????????????????
????????disY?=?eh?-?oh;

????document.onmousemove?=?function?(e)?{??????????
????????e?=?e?||?window.event;
????????fnMove(e,?disX,?disY);
????}
????document.onmouseup?=?function?()?{?????????????
????????document.onmousemove?=?null;
????????document.onmouseup?=?null;
????}
}


正在回答

3 回答

function?fnMove(e,posX,posY){
??var?oDrag=document.getElementById('loginPanel'),
??????l=e.clientX-posX,??//是變化的值
??????t=e.clientY-posY,
??????winW=document.documentElement.clientWidth?||?document.body.clientWidth,
??????winH=document.documentElement.clientHeight?||?document.body.clientHeight,
??????maxW=winW-oDrag.offsetWidth-10,
??????maxH=winH-oDrag.offsetHeight;
??if(l<0){
????l=0;
??}else?if(l>maxW){
????l=maxW;
??}
??if(t<0){
????t=10;
??}else?if(t>maxH){
????t=maxH;
??}
??oDrag.style.left=l+'px';
??oDrag.style.top=t+'px';
}


0 回復 有任何疑惑可以回復我~

fnMove(e,?disX,?disY); ?這個方法是怎么寫的?

0 回復 有任何疑惑可以回復我~
#1

加咖啡喵 提問者

我是這樣寫的 ; 下面的代碼(我自己回復的)
2017-09-27 回復 有任何疑惑可以回復我~
#2

加咖啡喵 提問者

我知道我哪里錯了 我的winH為150PX 為什么winH=document.documentElement.clientHeight || document.body.clientHeight,才150px呢 ? 我沒有寫錯呀
2017-09-27 回復 有任何疑惑可以回復我~

它說你沒定義 ?那你把

var?oDarg?=?document.getElementById('loginPanel'),

????????ow?=?oDarg.offsetLeft,

????????oh?=?oDarg.offsetTop,

????????ew?=?e.clientX,

????????eh?=?e.clientY,

????????disX?=?ew?-?ow,?????????????????????????

????????disY?=?eh?-?oh;

放到

document.onmousemove?=?function?(e)?{??????????

????????e?=?e?||?window.event;

????????fnMove(e,?disX,?disY);

????}

這里面試試。

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么的disY有錯呢?

我要回答 關注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號