< ;script type="text/javascript">
function showLogin() {
var loginDiv = document.getElementById("loginDiv");
var zhezhao = document.getElementById("zhezhao");
var clientx = document.documentElement.clientWidth;
var clienty = document.documentElement.clientHeight;
var l_margin = (clientx -parseInt(loginDiv.style.width)) / 2;
var t_margin = (클라이언트 -parseInt(loginDiv.style.height)-200) / 2
loginDiv.style.left = l_margin "px";
loginDiv.style.top = t_margin "px";
loginDiv.style .display = "block";
zhezhao.style.display = "block";
}
function hidLogin() {
var loginDiv = document.getElementById("loginDiv");
var zhezhao = document.getElementById ( "Zhezhao"); logindiv.style.display = "none"; zhezhao.style.display = "none"; var moveable = true;
var loginDiv = document.getElementById("loginDiv");
//以下变weight提前设置好 var clientX = window.event.clientX;
var clientY = window. event.clientY;
var moveTop =parseInt(loginDiv.style.top);
var moveLeft =parseInt(loginDiv.style.left);
document.onmousemove = function MouseMove() {
다음과 같은 경우 (이동 가능) {
var y = moveTop window.event.clientY - clientY;
var x = moveLeft window.event.clientX - clientX;
if (x & gt; 0 && y > 0) {
loginDiv.style.top = y "px";
loginDiv.style.left = x "px";
}
}
}
document.onmouseup = function Mouseup() {
moveable = false;
}
}
< div onmousedown="titleMove()" id="login_title" style="width:300px;height:25px; background-color:Blue;border:1px solid silver;border-left:none;border-right:none">
× < ;/div>