-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathm-select.html
76 lines (71 loc) · 1.75 KB
/
m-select.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<title>pui</title>
<link rel="stylesheet" href="css/global.css">
<script src="lib/jquery/1.9.1/jquery.min.js"></script>
<script src="lib/headroom/0.7.0/headroom.js"></script>
<script src="lib/template/template.min.js"></script>
<script src="js/global.js"></script>
<link rel="stylesheet" href="lib/m-select/1.0/m-select.css">
<script src="lib/m-select/1.0/m-select.js"></script>
<script src="lib/iscroll/iscroll.js"></script>
<style>
</style>
</head>
<body>
<div class="container">
<button onclick="cityPicker()">按钮</button>
</div>
<script>
function cityPicker() {
var d1 = [
{
id: 1,
name: '浙江省'
},
{
id: 2,
name: '江苏省'
}
]
var d2 = [
{
id: 1,
name: '浙江省'
},
{
id: 2,
name: '江苏省'
}
]
var d3 = [
{
id: 1,
name: '浙江省'
},
{
id: 2,
name: '江苏省'
}
]
var d = [d1,d2,d3];
var s = new MSelect(3,d,{
debug: true,
relation: [0,0],
key: 'id',
value: 'name',
callback: function(a,b,c) {
console.log(a);
},
render: function(el) {
return '<li data-id="'+el.id+'" data-value="'+el.name+'">'+el.id+'</li>';
}
});
}
</script>
</body>
</html>