This repository has been archived by the owner on Mar 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
/
demo_bootstrap.html
152 lines (144 loc) · 6.19 KB
/
demo_bootstrap.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DDSort</title>
<style>
body {
margin: 0;
height: 2000px;
}
.wrap {
width: 400px;
height: 300px;
margin: 200px auto;
padding-top: 20px;
border: 1px solid #ccc;
overflow: auto;
overflow-x: hidden;
position: relative;
}
ul {
padding: 0;
margin: 0;
}
li {
padding: 10px;
margin-bottom: 20px;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
font: 14px/1.5 "微软雅黑";
list-style: none;
cursor: move;
}
li:hover {
background-color: #f6f6f6;
}
div[contenteditable] {
border: 1px solid #ececec;
}
</style>
</head>
<body>
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
Launch demo modal
</button>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="wrap">
<ul>
<li>
世界上最美好的相遇是恰好,你洽好青春年少,我恰好青春芳华;
世界上最唯美的惊艳是偶然,你偶然出现,我偶然发现,
然后清纯的两颗心,慢慢地慢慢地靠近;
</li>
<li>
你飘逸的裙裾逶迤在我寂寞里飞马行空的诗行,<br>
跟随你的优雅舒缓的步履,
</li>
<li>
在相濡以沫心心相印的平凡日子里心香如故,<br>
刻写一个个浪漫和感动记忆的满面皱纹。
</li>
<li>
除了怀念,只剩怀念;<br>
除了无言,只能无言!
</li>
<li>
你飘逸的裙裾逶迤在我寂寞里飞马行空的诗行,<br>
跟随你的优雅舒缓的步履,
</li>
<li>
在相濡以沫心心相印的平凡日子里心香如故,<br>
刻写一个个浪漫和感动记忆的满面皱纹。
</li>
<li>
除了怀念,只剩怀念;<br>
除了无言,只能无言!
</li>
<li>
你飘逸的裙裾逶迤在我寂寞里飞马行空的诗行,<br>
跟随你的优雅舒缓的步履,
</li>
<li>
在相濡以沫心心相印的平凡日子里心香如故,<br>
刻写一个个浪漫和感动记忆的满面皱纹。
</li>
<li>
除了怀念,只剩怀念;<br>
除了无言,只能无言!
</li>
<li>一些事情,你愈是去遮掩愈是容易清晰,原本以为的瞒天过海,结果却是欲盖弥彰。</li>
<li>
A 链接测试:
<a href="http://music.163.com/">music.163.com</a>
</li>
<li>
input element 测试:
<input type="text">
</li>
<li>
contenteditable element 测试:
<div contenteditable="true">一些内容,内容...</div>
</li>
</ul>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<script src="//libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
<script src="ddsort.js"></script>
<script>
$('.wrap').DDSort({
target: 'li', // 示例而用,默认即 li
floatStyle: {
'border': '1px solid #ccc',
'background-color': '#fff'
},
// 由于 transform 的影响,对于类似 bootstrap 这样用了 transform 的元素,
// 需要手动处理拖拽元素的位置,如下
move: function (left, top) {
$(this).css('left', left - $('.modal-dialog').offset().left);
$(this).css('top', top - $('.modal-dialog').offset().top);
}
});
</script>
</body>
</html>