?? move.js
字號(hào):
var g_OO = null; // g_OperatingObject
var g_oldX, g_oldY;
var g_OT= 0; // g_OT
var g_Direction = null;
var g_CtrlPressed= false;
function LayerOnMouseOver() {
if (g_OT!=0) return;
g_OO= musicPlayer;
if(g_OO.resiziable==true) {
g_Direction= getDirection(musicPlayer);
if (g_Direction != "") {
g_OO.style.cursor= g_Direction + "-resize";
}
}
g_OO.style.cursor="default";
document.onmousemove= LayerOnMouseMove;
top.g_type=musicPlayer.type;
top.g_itemno=musicPlayer.itemno;
}
function LayerEndOperate() {
if (g_OT == 0) return false;
g_OT= 0;
document.onmousemove= null;
if(g_OO.id != "dset") g_OO.style.zIndex = 0;
g_OO.style.cursor= "default";
document.onmouseup= null;
g_Direction= null;
document.body.onselectstart = null;
//window.status="x="+g_OO.style.pixelLeft+";y="+g_OO.style.pixelTop;
return false;
}
function LayerOnMouseMove () {
g_Direction= getDirection(g_OO);
if (g_Direction != "") {
g_OO.style.cursor= g_Direction + "-resize";
}
else {
g_OO.style.cursor="default";
}
}
function LayerOnMouseOut ()
{
if (g_OT!=0) return;
//document.oncontextmenu = function() {return false;}
if(g_OO)
g_OO.onmousemove = null;
g_OO= null;
document.onmousemove= null;
//document.oncontextmenu = function() {return false;}
}
function getDirection (el) {
var dir = "";
var xPos = event.offsetX;
var yPos = event.offsetY;
//var offset = 4 * (parseInt(el.style.padding,10) + parseInt(el.style.borderWidth,10));
//if(offset < 3)
var offset = 4;
if (yPos <= offset)
{
dir = "n";
}
else if(yPos >= el.offsetHeight - offset)
{
dir = "s";
};
if (xPos <= offset)
{
dir += "w";
}
else if (xPos >= el.offsetWidth - offset)
{
dir += "e";
};
return dir;
}
function LayerStartOperate()
{
if(event.button==1) {
if (g_OO == null ) return;
if(g_OO.id != "dset") g_OO.style.zIndex=100; // 把當(dāng)前操作的層提到最上層
/// 判斷操作類型
g_Direction= getDirection(g_OO);
if (g_Direction != "") {
g_OT= 2;
if(g_OO.resiziable==true)
{
document.onmousemove= LayerResize;
}
}
else {
g_OT= 1;
document.onmousemove= LayerMoving;
g_OO.style.cursor="move";
}
//-
g_oldX= event.x;
g_oldY= event.y;
document.onmouseup= LayerEndOperate;
// 禁止文字選擇
document.body.onselectstart = new Function("return false");
return false;
}
else if (event.button==2&&top.g_type==2||event.button==2&&top.g_type==3||event.button==2&&top.g_type==12) {
top.document.oncontextmenu = showmenuie5;
top.document.onclick = hidemenuie5;
}else {
return false;
}
}
function LayerMoving()
{
if (g_OT != 1) return;
g_OO.style.pixelLeft = g_OO.style.pixelLeft + (event.x- g_oldX);
g_OO.style.pixelTop = g_OO.style.pixelTop + (event.y- g_oldY);
g_oldX= event.x;
g_oldY= event.y;
top.g_EditFlag= 1;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -