}
function hideLogin() {
var divLogin = document.getElementById("divLogin");
divLogin.style.display = "none";
}
/********************************实现windows窗体移动效果*************************/
//var x, y;//存储鼠标在moveWin的层上按下时,相对于这个层左上角的坐标值
function winMouseDown() {
// var x = window.event.offsetX;
//var y = window.event.offsetY;
var divMove = document.getElementById("moveWin");
//将鼠标在moveWin的层上按下时,相对于这个层左上角的坐标值存储在id为moveWin的层的自定义属性中
divMove.setAttribute("x",window.event.offsetX);
divMove.setAttribute("y",window.event.offsetY);
document.onmousemove = function () {
/*测试代码
alert('sssss');
var inputa = document.createElement("input");
inputa.type = "button";
inputa.value = "你好";
document.body.appendChild(inputa);*/
var divMove = document.getElementById("moveWin");
var divLogin = document.getElementById("divLogin");
var divMoveX = window.event.clientX;
var divMoveY = window.event.clientY;
var x = divMove.getAttribute("x");
var y = divMove.getAttribute("y");
if (divMoveY < 0) {
return;
}
var xx = divMoveX - x;
var yy = divMoveY - y;
divLogin.style.left = xx + "px";
divLogin.style.top = yy + "px";
};
}
//鼠标松开时,使onmousemove事件不起作用
function winMouseUp() {
document.onmousemove = function () {
window.event.returnValue = false;
};
}
//避免鼠标在其他地方松开时,不能消除onmousemove事件
document.onmouseup = function () {
document.onmousemove = function () {
window.event.returnValue = false;
};
};