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

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

為什么釋放鼠標不起作用?

//IE10-不支持getElementsByClassName

function getClass(className, parent) {

var oParent = parent ? document.getElementById(parent) : document;

var eles = [];

var elem = oParent.getElementsByTagName("*");

// alert(elem.length);

for (var i = 0; i < elem.length; i++) {

// alert(elem[0].className);

if (elem[i].className == className) {

eles.push(elem[i]);

}

}

return eles;

}


window.onload = drap;


function drap() {

var login = getClass("login_logo_webqq", "loginPanel")[0];

// var login = document.getElementsByClassName("login_logo_webqq")[0];

var loginPanel = document.getElementById("loginPanel");

// alert(login.className);

login.onmousedown = mDown;


function mDown(e) {

// alert("hello");

var postX, postY;

e = e || window.event;

postX = e.clientX - loginPanel.offsetLeft;

// alert(postX);

postY = e.clientY - loginPanel.offsetTop;


document.onmouseover = function(e) {

e = e || window.event;

mMove(e, postX, postY);

// alert(postX+" "+postY);

}

// 釋放鼠標

document.onmouseup = function() {

document.onmousemove = null;

document.onmouseup = null;?

}

}


function mMove(e, postX, postY) {

var e = e || window.event;

var x, y;

x = e.clientX - postX;

y = e.clientY - postY;

// alert(x);

// 整個顯示區(qū)域的寬度

var winW = document.documentElement.clientWidth || document.body.clientWidth;

winH = document.documentElement.clientHeight || document.body.clientHeight;

// alert(winW);

var offW = loginPanel.offsetWidth,

// alert(offW);

offH = loginPanel.offsetHeight;

var moveW = winW - offW,

moveH = winH - offH;

// alert(moveW);


if (x < 0) {

x = 0

} else if (x > moveW) {

x = moveW - 10;

}

if (y < 0) {

y = 10;

} else if (y > moveH) {

y = moveH;

}

loginPanel.style.left = x + 'px';

loginPanel.style.top = y + 'px';

document.title = x + " " + y;

}

}


正在回答

2 回答

document.onmouseover = function(e) {}

寫錯了吧,應(yīng)該是 onmousemove


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

Chris_Stone 提問者

非常感謝!
2016-09-09 回復 有任何疑惑可以回復我~

document.onmouseup = null;
?可以把這句注釋了看看


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

舉報

0/150
提交
取消

為什么釋放鼠標不起作用?

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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