moviediv.js

来自「轩圆学生信息管理系统[高中版] 程序功能:添加链接、修改链接、删除链接、清空链接」· JavaScript 代码 · 共 43 行

JS
43
字号
var dragapproved=false;
var z,x,y,temp1,temp2;
function move()
{
if (event.button==1&&dragapproved){
	z.style.pixelLeft=temp1+event.clientX-x;
	z.style.pixelTop=temp2+event.clientY-y;
	return false;
	}
}
function mup()
{
	if (!document.all)
	return;
	if (event.srcElement.className=="LFace"||event.srcElement.className=="lface"){ 
		dragapproved=false;
		z=event.srcElement;
		z.style.background="#f4f9fe";
		z.style.cursor="";
	}
}
function drags(){
	if (!document.all)
	return;
	if (event.srcElement.className=="LFace"||event.srcElement.className=="lface"){ 
		dragapproved=true;
		z=event.srcElement;
		z.style.background="";
		z.style.cursor="move";
		temp1=z.style.pixelLeft;
		temp2=z.style.pixelTop;
		if (temp2==0)
		{
			temp2 = 100;
		}
		x=event.clientX;
		y=event.clientY;
		document.onmousemove=move;
	}
}
document.onmousedown=drags;
document.onmouseup=mup;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?