<!DOCTYPE html>
<html>
<head>
<title>函数的简单调用</title>
<meta charset="utf-8">
<style type="text/css">
html,body{
width: 100%;
height: 100%;
}
.move_out{
position: absolute;
cursor: hand;
font-family: "华文行楷";
} </style>
<script type="text/javascript">
var move_out = false;
var z,x,y;
function move(){
if (event.button==move_out) {
z.style.pixelLeft=temporarily1+event.clientX-x;
z.style.pixelTop=temporarily2+event.clientY-y;
return false;
}
}
function down(){

if (event.srcElement.className == "move_out") {
move_out=true;
 z=event.srcElement;
temporarily1 =z.style.pixelLeft;
temporarily2 =z.style.pixelTop;
x = event.clientX;
y = event.clientY;
document.onmousedown=move;
}else{
move_out=false;
}
}
document.onmousedown = down;
</script>
</head>
<body >
<font class="move_out">文字跟随鼠标移动</font>
</body>
</html>