zoukankan
html css js c++ java
[JavaScript]鼠标拖动
代码很简单:
<div id="divMove" style="POSITION: absolute;left:300;top:300" onselectstart="return false" onmousedown="MouseDown(this)" onmousemove="MouseMove()"> <table width="150" cellpadding="0" cellspacing="0" border="1"> <tr> <td height="30" bgcolor="#cccccc">title</td> </tr> <tr> <td height="100"><p align="center">testMove</p></td> </tr> </table> </div> <SCRIPT LANGUAGE="JavaScript"> <!-- var currentMoveObj = null; var relLeft,relTop; function MouseDown(obj) { currentMoveObj = obj; currentMoveObj.style.position = "absolute"; relLeft = event.x - currentMoveObj.style.pixelLeft; relTop = event.y - currentMoveObj.style.pixelTop; } window.document.onmouseup = function() { currentMoveObj = null; } function MouseMove() { if(currentMoveObj != null) { currentMoveObj.style.pixelLeft=event.x-relLeft; currentMoveObj.style.pixelTop=event.y-relTop; } } //--> </SCRIPT>
查看全文
相关阅读:
MySQL的备份和恢复-mysqldump
MySQL日志功能详解
MySQL查询缓存
MySQL的用户管理
doc常用命令
记录mysql语句
centos常用命令
centos 7.6
centos6 常用命令
centos6.8 安装软件
原文地址:https://www.cnblogs.com/HD/p/101408.html
最新文章
关于TCP/IP三次握手和四次分手的理解
WPF Dispatcher及线程
GC 垃圾回收机制
关于C#中的异常捕捉
vmware 虚拟机随系统开机自启动
华为交换机打开或者关闭告警信息命令
centos7网卡配置文件
域帐号锁定策略
域策略计划任务0x80070005拒绝访问的解决方法
bat后台运行
热门文章
bat脚本创建桌面快捷方式
exchange2010配置匿名接收连接器,匿名发送邮件
从网络共享打开文件时的安全警告
Windows Server 2012体验之重复数据删除技术
Nginx核心配置-根目录root指令与别名alias指令实战案例
Nginx核心配置-单节点实现多域
Nginx核心配置-新建一个web站
Nginx常见的安装方式
Nginx基础知识介绍
MySQL数据库语法-多表查询练习一
Copyright © 2011-2022 走看看