-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
204 lines (198 loc) · 8.89 KB
/
demo.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8" mobile="true">
<title>The Demo for Cmobile.js</title>
<script type="text/javascript" src="Lib/Cmobile.js"></script>
<link rel="stylesheet" type="text/css" href="Lib/Cmobile.css">
<style type="text/css">
body{font-family: "\5fae\8f6f\96c5\9ed1", "Microsoft YaHei", SimHei, Helvetica, Arial, SimSun;font-size: 15px;max-width: 640px;margin: 0 auto;}
body>div{/*border:1px solid gray;*/margin-top: 10px;}
img{max-width: 100%;}
.border{border:1px solid #969696;}
.slide{width: 300px;height: 150px;margin: 10px auto;}
p{width: 300px;margin: 0 auto;}
.countdown{margin: 10px auto;}
.countdown span{background-color: gray;display: inline-block;width: 30px;height: 30px;border-radius: 10px 10px;text-align: center;line-height: 30px;}
.pop{display: none;width: 70%;background-color: #999;height: 200px;text-align: center;}
.pop-1{display: none;width: 60%;background-color: #bbb;height: 150px;text-align: center;}
.pop_btn{width: 120px;background-color: #888;margin: 10px auto;border-radius: 10px 10px;text-align: center;font-family: "\5fae\8f6f\96c5\9ed1", "Microsoft YaHei", SimHei, Helvetica, Arial, SimSun}
.one{width: 49%;float: left;}
</style>
</head>
<body>
<p style="font-size:20px">The Demo for Cmobile.js</p>
<div class="border">
<p>The Demo For Slide Component </p>
<div class="slide"></div>
<script type="text/javascript">
var area=document.querySelector(".slide");
var urlarr=["http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1431572617553.jpg","http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1431572617553.jpg","http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1431572617553.jpg"],
linkarr=["http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1431572617553.jpg","http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1431572617553.jpg","http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1431572617553.jpg"];
mobile.slide(1,area,3,urlarr,linkarr,{"width":300,"height":150},"1s",true,3000);
document.querySelector(".slide").addEventListener("click",function (e){
var target=e.target;
if(target.tagName=="IMG")
window.location.href=target.getAttribute("link");
});
</script>
</div>
<div class="border">
<p>The Demo For CountDown Component </p>
<div class="countdown">
<span class="day"></span>:
<span class="hour"></span>:
<span class="minute"></span>:
<span class="second"></span>
</div>
<script type="text/javascript">
mobile.countDown(new Date(2015,10,26,14,00,00),{"day":true,"hour":true,"minute":true,"second":true});
</script>
</div>
<div class="border">
<p>The Demo For Pop Component </p>
<div class="pop_btn">Click for pop</div>
<div class="alert_btn">Alert for pop</div>
<div class="pop">
Pop success!
</div>
<div class="pop-1" style="display: none;">
Pop success1!
</div>
<div class="alert" style="display: none">
alert success1!
</div>
<script type="text/javascript">
var popconfigobj={
"elementStr":'.pop',//必传
"top":100,//必传
"elementDisplay":"block",//必传
"opacity":60,//非必传,默认50
"closeElementStr":'.pop',//非必传
"closeModel":""//非必传
};
var popconfigobj_1={
"elementStr":'.pop-1',//必传
"top":100,//必传
"elementDisplay":"block",//必传
"opacity":60//非必传,默认50
};
document.querySelector('.alert_btn').addEventListener("click",function(){
// mobile.pop(popconfigobj);
// alert("we");
mobile.alert("警告!是大神大神大神大神大神大神大神大神大神",2);
});
document.querySelector('.pop_btn').addEventListener("click",function(){
mobile.pop(popconfigobj);
mobile.pop(popconfigobj_1);
});
document.querySelector('.pop-1').addEventListener("click",function(){
mobile.removePop(popconfigobj_1);
mobile.alert("body",1);
});
</script>
</div>
<div class="cc border">
<input type="text" />
</div>
<div class="doT">
</div>
<table>
<tr>
<td>省份</td>
<td>
<select name="" id="province">
</select>
</td>
</tr>
<tr>
<td>市</td>
<td>
<select name="" id="city"></select>
</td>
</tr>
<tr>
<td>区/县</td>
<td>
<select name="" id="district"></select>
</td>
</tr>
</table>
<input type="hidden" value="340000" id="pre_province">
<input type="hidden" value="340800" id="pre_city">
<input type="hidden" value="340803" id="pre_district">
<div class="form">
<input type="text" name="name">
<input type="text" name="age">
</div>
<div class="autoLoadMore" style="background: #333;padding: 20px;">
<img data-src="http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1431572617553.jpg" alt="" class="one" style="height: 180px;">
<img data-src="http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1441527782575.jpg" alt="" class="one" style="height: 180px;">
<img data-src="http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1447038190145.jpg" alt="" class="one" style="height: 180px;">
<img data-src="http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1438913663261.jpg" alt="" class="one" style="height: 180px;">
<img data-src="http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1438913654618.jpg" alt="" class="one" style="height: 180px;">
<img data-src="http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1444631980385.jpg" alt="" class="one" style="height: 180px;">
<img data-src="http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1435029612508.jpg" alt="" class="one" style="height: 180px;">
<img data-src="http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1435029621252.jpg" alt="" class="one" style="height: 180px;">
<img data-src="http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1447038190145.jpg" alt="" class="one" style="height: 180px;width: 100%;">
<img data-src="http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1447038190145.jpg" alt="" class="one" style="height: 180px;width: 100%;">
<img data-src="http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1447038190145.jpg" alt="" class="one" style="height: 180px;width: 100%;">
<img data-src="http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1447038190145.jpg" alt="" class="one" style="height: 180px;width: 100%;">
<img data-src="http://b.zol-img.com.cn/desk/bizhi/image/6/1366x768/1447038190145.jpg" alt="" class="two" style="height: 180px;width: 100%;">
</div>
<script id="dot" type="text/x-dot-template">
<p>name:{{=it.name}}</p>
</script>
<script type="text/javascript">
mobile.calendar(".cc input",{
"format":"yy-MM-dd 周day"
});
mobile.one(".form").serializeJSON();
mobile.lazyLoad(mobile.all(".one"));
mobile.ajax({
url:"/ajaxSource/ajax.txt",
type:"post",
dataType:"html",
data:{b:11,c:'陈哲'},
success: function(msg){
alert( "Data Saved: " + msg.age );
mobile.one("body").append(msg);
},
error: function(){
alert( "ajax请求失败" );
},
timeout:60
});
mobile.autoLoadMore({
loadElement:".autoLoadMore",
url:"/ajaxSource/ajax.txt",
type:"get",
dataType:"text",
data:{b:11,c:'cz'},
success: function(msg){
// alert( "Data Saved: " + msg.age );
mobile.one(".autoLoadMore").append(msg);
mobile.lazyLoad(mobile.all(".autoLoadMore img"));
},
error: function(){
alert( "ajax请求失败" );
},
timeout:60
});
var data={name:"chenzhe"};
var dot=mobile.one("#dot").html();
var template=doT.template(dot);
mobile.one(".doT").append(template(data));
mobile.dom("body").addEventListener("click",f,false);
var s=0;
mobile.dom("body").addEventListener("click",f,false);
function f(){
// alert(1)
}
function ff(){
alert(1)
}
mobile.areaChose("Lib/mobile-json-of-province.js","Lib/mobile-json-of-city.js","Lib/mobile-json-of-district.js");
</script>
</body>
</html>