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>
查看全文
相关阅读:
EdgeDB 1.0 Alpha 4 发布了
静态文件请求路径 rewrite nginx && openresty 实现
Giving Application Pools Event Log Access
一张图看懂ASP.NET MVC5认证和授权过滤器的执行顺序
git check-ignore
What does “Challenge” term stand for?
Implementing MVC 5 IAuthenticationFilter
HttpContext.Current.User is null even though Windows Authentication is on
When should the volatile keyword be used in C#?
HttpApplicationState.Remove(String) Method
原文地址:https://www.cnblogs.com/HD/p/101408.html
最新文章
ARM GIC(三) gicv2架构【转】
of_node_put【转】
ARM GIC(四) gicv3架构基础【转】
mailbox数据发送和接收的过程【转】
linux mailbox模型【转】
Linux内核中断系列之多处理器系统中的中断处理(七)【转】
全面解析Linux 内核 3.10.x
处理器间中断处理(IPI)【转】
IPI 通信(SMP)【转】
核间通信原理【转】
热门文章
关于双核通信通过共享内存交换数据ARM端程序的学习【转】
LINUX共享内存使用常见陷阱与分析【转】
踩坑 Spring Cloud Hystrix 线程池队列配置
Spring Boot AOP 切面统一打印请求与响应日志
python测试开发django-74.auth认证之is_active
vue-cli 3.0 index.html引入第三方js文件
ASP.NET Core WebApi+EF Core轻量级文件系统实战演练
THttpApiWebSocketServer注意事项
errors 一个很不错的golang 异常处理包
使用nginx limit_rate 解决用户下载限速
Copyright © 2011-2022 走看看