js之鼠标的拖曳效果
效果如下:
下面是代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>鼠标拖曳效果</title>
<style>
body{
background:black;
}
#box{
position:absolute;
background: rgb(148, 143, 143);
width: 400px;
height: 200px;
box-sizing: border-box;
border: white 2px solid;
}
.topTitle{
cursor: move;
border-bottom: white 2px solid;
background: #cccccc;
text-align: right;
color: white;
height: 20px;
line-height: 20px;
}
.content >div{
background:<