一个层拖拽及鼠标跟随效果
2009-07-01 15:15
183 查看
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<div id="dragDiv" style="z-index:9999;position: absolute; left:0; top:0;overflow:hidden;width:160;height:100%" onMouseDown="Start()" onMouseUp="End()">
hello world!
</div>
<script language="javascript" type="text/javascript">
var dv = document.getElementById("dragDiv").style;
var bDrag;
function document.onmousemove(){
if(bDrag && window.event.button==1){
dv.posLeft = window.event.clientX;
dv.posTop = window.event.clientY;
}
}
function Start(){
bDrag=true;
dv.cursor = "move";
}
function End(){
bDrag = false;
dv.cursor = "default";
}
</script>
</body>
</html>
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<div id="dragDiv" style="z-index:9999;position: absolute; left:0; top:0;overflow:hidden;width:160;height:100%" onMouseDown="Start()" onMouseUp="End()">
hello world!
</div>
<script language="javascript" type="text/javascript">
var dv = document.getElementById("dragDiv").style;
var bDrag;
function document.onmousemove(){
if(bDrag && window.event.button==1){
dv.posLeft = window.event.clientX;
dv.posTop = window.event.clientY;
}
}
function Start(){
bDrag=true;
dv.cursor = "move";
}
function End(){
bDrag = false;
dv.cursor = "default";
}
</script>
</body>
</html>
相关文章推荐
- CSS3+jQuery鼠标跟随图片悬停效果 零玖玖教育
- 实现鼠标跟随的放大镜效果
- 跟随鼠标的时钟,外面一层是系统日期,还带旋转效果
- 鼠标文字跟随效果
- 跟随鼠标的图片放大效果
- javascript跟随鼠标的文字带滚动效果
- JQuery鼠标跟随效果
- JQuery实现一个简单的鼠标跟随提示效果
- 鼠标跟随运动效果
- Javascript 鼠标移动上去 滑块跟随效果代码分享
- Silverlight UserControl拖动 或鼠标跟随效果
- CSS3实现一个鼠标跟随动态旋转效果
- jquery实现鼠标拖拽滑动效果来选择数字的方法
- jquery实现鼠标拖拽滑动效果来选择数字的方法
- 鼠标跟随提示效果
- javascript实现图片跟随鼠标移动效果的方法
- Android实现View拖拽跟随手指移动效果
- 跟随鼠标一串效果---七彩贪吃蛇
- 原生js如何做一个链式运动,JavaScript怎么做鼠标跟随效果
- 基于JQuery的一个简单的鼠标跟随提示效果