<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>拖动</title>
</head>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
.loginPanel{
width: 380px;
height: 247px;
left: 400px;
top: 120px;
position: absolute;
border: 1px solid #ccc;
background: #f6f6f6;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
-moz-box-shadow: 0 0 8px #000;
-webkit-box-shadow: 0 0 8px #000;
box-shadow: 0 0 8px #000;
}
</style>
<body>
<div class="loginPanel" id="loginPanel">
</div>
<script type="text/javascript">
window.drag;
function drag(){
var Panel=document.getElementById("loginPanel");
Panel.fnDown;
}
function fnDown(event){
event = event || window.event;
var oDrag=document.getElementById('loginPanel');
var disX=event.clientX-
【web前端实践】-----实现面板拖拽效果
最新推荐文章于 2024-06-22 18:54:12 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)