wn_drog: function() {
//斜拉窗口变化
bottomControlDiv.onmousedown = function(e) {
e.preventDefault();//阻止默认事件 这个很重要
if (e.which == 1) {// 鼠标左键操作
var oldX = e.clientX;// 获取第一次点击的坐标
var oldY = e.clientY;
var iWidth=document.getElementById("mywindow").offsetWidth;
var iHeight=document.getElementById("mywindow").offsetHeight;
document.onmousemove = function(event) {
var event = event;
if(InitNum.adjust) {
InitNum.dragWidth = disX;
InitNum.dragHeight = disY;
ChangeWindow(disX, disY, InitNum.dragTop, InitNum.dragLeft, win);
} else {
return;
}
}
document.onmouseup = function() {
document.onmousemove = null;
}
}
}
bottomControlDiv.onmouseup = function(e) { //移动事件的鼠标被松开时
document.onmousemove = null;
}
//斜拉窗口变化
bottomControlDiv.onmousedown = function(e) {
e.preventDefault();//阻止默认事件 这个很重要
if (e.which == 1) {// 鼠标左键操作
var oldX = e.clientX;// 获取第一次点击的坐标
var oldY = e.clientY;
var iWidth=document.getElementById("mywindow").offsetWidth;
var iHeight=document.getElementById("mywindow").offsetHeight;
document.onmousemove = function(event) {
var event = event;
var disX = event.clientX -oldX+ iWidth; //注意这里一定要用拖动的时候的坐标减去远点mousedown的坐标,再加上原本DIV的宽度
var disY = event.clientY -oldY+iHeight; //而不是直接在这里接用拖动的时候的坐标减去了DIV的offsetleft,要不然拖动的时候会发生一点小BUGif(InitNum.adjust) {
InitNum.dragWidth = disX;
InitNum.dragHeight = disY;
ChangeWindow(disX, disY, InitNum.dragTop, InitNum.dragLeft, win);
} else {
return;
}
}
document.onmouseup = function() {
document.onmousemove = null;
}
}
}
bottomControlDiv.onmouseup = function(e) { //移动事件的鼠标被松开时
document.onmousemove = null;
}
}
第一次写博客 嘿嘿嘿 努力变更好