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>
查看全文
相关阅读:
[算法] 选择排序和插入排序
[Machine-Learning] 机器学习中的几个度量指标
[SDN] What is SDN?
SpringBoot注解大全*(转发:http://www.cnblogs.com/ldy-blogs/p/8550406.html)
java定时器的使用(Timer)(转发:https://blog.csdn.net/ecjtuxuan/article/details/2093757)
Quartz使用总结(转发:http://www.cnblogs.com/drift-ice/p/3817269.html)
Spring IOC/DI和AOP原理(转发:https://www.cnblogs.com/techroad4ca/p/5770073.html)
Java设计模式之《单例模式》及应用场景(转发:http://www.cnblogs.com/V1haoge/p/6510196.html)
JDBC注册驱动程序的三种方式
数据库三范式的简单理解
原文地址:https://www.cnblogs.com/HD/p/101408.html
最新文章
Babel 安装教程
js运算符单竖杠“|”的用法和作用及js数据处理
javascript实用技巧,js小知识
hdfs shell的基本操作以及hdfsWeb查看文件
hadoop集群搭建(hdfs)
linux服务器ssh免密码登录
java内存模型(jMM)(二)
mysql5.6安装
redis安装
java内存模型(jMM)(一)
热门文章
JSR133规范学习
java集合类学习笔记之LinkedHashMap
java集合类学习笔记之HashMap
[Machine-Learning] 熟悉 Matlab 中的 map
[Machine-Learning] 熟悉Matlab
[LeetCode_5] Longest Palindromic Substring
[LeetCode_2] Add Two Numbers
[LeetCode_3] Longest Substring Without Repeating Characters
[Machine-Learning] K临近算法-简单例子
[Machine-Learning] 熟悉 Numpy
Copyright © 2011-2022 走看看