-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex6.html
More file actions
172 lines (153 loc) · 4.13 KB
/
index6.html
File metadata and controls
172 lines (153 loc) · 4.13 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>jQuery拖放插件DAD演示-允许/禁止拖放</title>
<link rel="stylesheet" href="css/jquery.dad.css">
<style>
.jq22 {
width: 1000px;
margin: 0 auto;
font-family: arial,SimSun;
font-size: 0;
}
.jq22 .item {
display: inline-block;
width: 180px;
height: 100px;
margin-right: 20px;
}
.jq22 .item1 {
background-color: #1faeff;
}
.jq22 .item2 {
background-color: #ff2e12;
}
.jq22 .item3 {
background-color: #00c13f;
}
.jq22 .item4 {
background-color: #e1b700;
}
.jq22 .item5 {
background-color: #7200ac;
}
.jq22 span {
display: block;
height: 100px;
line-height: 100px;
font-size: 2rem;
text-align: center;
color: #fff;
}
.btns {
width: 1000px;
margin-left: auto;
margin-right: auto;
}
body {
margin: 0;
border-left: 200px solid #ccc;
}
h1 {
width: 1000px;
margin: 40px auto;
font: 32px "Microsoft Yahei";
}
.jq22 {
width: 1000px;
margin: 0 auto;
}
.menu {
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 200px;
padding-top: 100px;
font-family: Consolas,arial,"宋体";
background-color: #ccc;
}
.menu a {
display: block;
height: 40px;
margin: 0 0 1px 2px;
padding-left: 10px;
line-height: 40px;
font-size: 14px;
color: #333;
text-decoration: none;
}
.menu a:hover {
background-color: #eee;
}
.menu .cur {
color: #000;
background-color: #fff !important;
}
.vad {
margin: 150px 0 10px;
font-family: Consolas,arial,宋体,sans-serif;
text-align: center;
}
.vad a {
display: inline-block;
height: 36px;
line-height: 36px;
margin: 0 5px;
padding: 0 50px;
font-size: 14px;
text-align: center;
color: #eee;
text-decoration: none;
background-color: #222;
}
.vad a:hover {
color: #fff;
background-color: #000;
}
.thead {
width: 728px;
height: 90px;
margin: 0 auto;
border-bottom: 40px solid transparent;
}
</style>
</head>
<body>
<h1>允许/禁止拖放</h1>
<div class="jq22">
<div class="item item1"><span>1</span></div>
<div class="item item2"><span>2</span></div>
<div class="item item3"><span>3</span></div>
<div class="item item4"><span>4</span></div>
<div class="item item5"><span>5</span></div>
</div>
<p class="btns"><a class="btn1" href="javascript:">允许拖放</a> <a class="btn2" href="javascript:">禁止拖放</a></p>
<div class="menu">
<a href="index.html">1、水平拖放</a>
<a href="index2.html">2、垂直拖放</a>
<a href="index3.html">3、多行拖放</a>
<a href="index4.html">4、指定拖动区域</a>
<a href="index5.html">5、回调函数</a>
<a class="cur" href="index6.html">6、允许/禁止拖放</a>
<a href="index7.html">7、仿垃圾篓</a>
<a href="index8.html">8、仿购物车</a>
</div>
</body>
</html>
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/jquery.dad.min.js"></script>
<script>
$(function() {
var n = $('.jq22').dad();
$('.btn1').on('click',
function() {
n.activate();
});
$('.btn2').on('click',
function() {
n.deactivate();
});
});
</script>