Html
    Css
    Js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#bg {
display:none;
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background-color:#333;
}
* {
margin:0;
padding:0;
box-sizing:border-box;
}
a {
text-decoration:none;
}
.login-header {
margin:0 auto;
text-align:center;
}
#link {
color:#000;
line-height:40px;
font-size:24px;
}
.login {
display:none;
position:fixed;
left:50%;
top:50%;
transform:translate(-50%,-50%);
margin:50px auto;
width:500px;
height:200px;
box-shadow:0px 0px 20px #fff;
background-color:#fff;
}
.login-title {
text-align:center;
margin-bottom:30px;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
↑上面代码改变,会自动显示代码结果 jQuery调用版本:1.11.3
 立即下载

js拖动模态框(原创)

更新时间:2021-12-03 00:57:28

这是通过原生代码,不需要借助外部插件,就可以实现和微信登录弹窗一样可以通过鼠标拖动的盒子

1
      花开莫与流年错评论奖励 1 jQ币
      2022/2/28 8:36:50
      模态框在移动的时候,可以做一下限制,如:不能移除可视区域;而且在鼠标点击后移动时,有bug,非必现。 回复