-
Notifications
You must be signed in to change notification settings - Fork 0
/
数字输入框.html
46 lines (40 loc) · 1.58 KB
/
数字输入框.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
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link href="css/mui.min.css" rel="stylesheet" />
</head>
<body>
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">栅格</h1>
</header>
<div class="mui-content">
<div class="mui-numbox" data-numbox-step='1' data-numbox-min='0' data-numbox-max='10'>
<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
<input class="mui-input-numbox" type="number" />
<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
</div>
<button type="button" class="mui-btn mui-btn-primary" id="numbox1">获取当前值</button>
<button type="button" class="mui-btn mui-btn-primary" id="numbox2">设置新值</button>
<button type="button" class="mui-btn mui-btn-primary" id="numbox3">设置步长</button>
</div>
<script src="js/mui.min.js"></script>
<script type="text/javascript">
mui.init();
mui(document.body).on('tap','#numbox1',function(e){
mui.toast('值为'+mui('.mui-numbox').numbox().getValue())
});
mui(document.body).on('tap','#numbox2',function(e){
mui('.mui-numbox').numbox().setValue(5);
mui.toast('值为'+mui('.mui-numbox').numbox().getValue())
});
mui(document.body).on('tap','#numbox3',function(e){
mui('.mui-numbox').numbox().setOption('step',5);
mui.toast('步长为5')
});
</script>
</body>
</html>