-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
103 lines (98 loc) · 3.11 KB
/
index.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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="css.css" rel="stylesheet" />
<script src="select-plugin.js"></script>
<style type="text/css">
.container {
background:#aaa;
padding:20px;
}
.select {
position: relative;
display: inline-block;
width: 300px;
}
.select-options {
position: absolute;
width: 100%;margin-top: -1px;
}
.select-options ul {
padding:5px;
background:#fff;border:1px solid #efefef;
line-height:1.6;
cursor:pointer;
}
.select-options ul li {
padding:3px;
}
.select-options ul li:hover {
background:#efefef;
}
.selected {
height: 2em;
line-height: 2em;
border: 1px solid #efefef;
background:#fff;
padding:4px 10px;
cursor:pointer;
}
.arrow {
position:absolute;
right:15px;
top:50%;
width:15px;height:15px;line-height:15px;font-size:12px;
font-family:SimSun;
margin-top:-7px;
font-style:normal;
}
/*.arrow-up:before {
content:'▼'
}
.arrow-down:before {
content:'▲'
}*/
</style>
</head>
<body>
<div class="container">
<div class="select" id="wrapper">
<div class="selected">
<i class="arrow">▼</i>
<input type="hidden" value="" />
<span class="select">请选择</span>
</div>
<div class="select-options" style="display:none;">
<ul>
<li class="select-option" data-value="北京市">北京市</li>
<li class="select-option" data-value="上海市">上海市</li>
<li class="select-option" data-value="合肥市">合肥市</li>
</ul>
</div>
</div>
<div class="select" id="Div1">
<div class="selected">
<i class="arrow">▼</i>
<input type="hidden" value="" />
<span class="select">请选择</span>
</div>
<div class="select-options" style="display:none;">
<ul>
<li class="select-option" data-value="北京市">北京市</li>
<li class="select-option" data-value="上海市">上海市</li>
<li class="select-option" data-value="合肥市">合肥市</li>
</ul>
</div>
</div>
</div>
<script>
var dropMenu = new globelSelect("#wrapper");
var dropMenu1 = new globelSelect("#Div1");
dropMenu.on('select', function (d) {
console.log(d);
});
</script>
</body>
</html>