-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdropdown.html
47 lines (43 loc) · 1.64 KB
/
dropdown.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>下拉菜单Demo</title>
<link rel="stylesheet" type="text/css" href="css/ch-ui.css"/>
<style>
h1{position: absolute;left: 50px;top: 40px;}
.test-dropdown1{width: 100px;height: 35px;position: absolute;left: 50px;top: 100px;}
.test-dropdown2{width: 60px;height: 32px;position: absolute;left: 200px;top: 100px;}
.test3{width: 400px;height: 200px;position: absolute;left: 310px;top: 100px;}
.test-dropdown3{width: 100px;height: 35px;float: left;margin-right: 10px;}
.content{width: 200px;height: 280px;float: left;border: 1px solid #d0d0d0;overflow: auto;border-radius: 5px;}
.content p{width: 200px;height: 32px;line-height: 32px;text-align: center;border-bottom: 1px solid #D0D0D0;}
</style>
</head>
<body>
<h1>下拉菜单Demo</h1>
<div class="test-dropdown1"></div>
<div class="test-dropdown2"></div>
<div class="test3">
<div class="test-dropdown3"></div>
<div class="content"></div>
</div>
<script src="js/libs/bower_components/jquery/dist/jquery.js"></script>
<script src="js/apps/ch-ui.js"></script>
<!-- 调用 -->
<script>
$('.test-dropdown1').dropdown({
text: ["读书","运动","音乐","编程"]
});
$('.test-dropdown2').dropdown({
text: ["销量","价格","好评","人气"]
});
$('.test-dropdown3').dropdown({
text: ["JavaScript","Python","PHP","Java","C","C++","Object-C"]
});
$('.test-dropdown3').on("itemChanged",function(event,data){
$('.content').append("<p>"+data+"</p>");
});
</script>
</body>
</html>