-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
159 lines (149 loc) · 5.25 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
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
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>底部导航</title>
<link rel="stylesheet" type="text/css" href="./css/api.css"/>
<link rel="stylesheet" type="text/css" href="./css/style.css"/>
<style>
#footer{ background-color: #FFFFFF }
#footer ul li{ padding-top: 36px; padding-bottom: 4px; background: url() no-repeat center 2px; background-size: auto 30px; text-align: center; }
#footer ul li.active{ color: #3498DB; }
#footer ul li:nth-child(1){ background-image: url(./image/sy0.png); }
#footer ul li:nth-child(2){ background-image: url(./image/fk0.png); }
#footer ul li:nth-child(3){ background-image: url(./image/shequ0.png); }
#footer ul li:nth-child(4){ background-image: url(./image/dt0.png); }
#footer ul li:nth-child(5){ background-image: url(./image/geren0.png); }
#footer ul li:nth-child(1).active{ background-image: url(./image/sy1.png); }
#footer ul li:nth-child(2).active{ background-image: url(./image/fk1.png); }
#footer ul li:nth-child(3).active{ background-image: url(./image/shequ1.png); }
#footer ul li:nth-child(4).active{ background-image: url(./image/dt1.png); }
#footer ul li:nth-child(5).active{ background-image: url(./image/geren1.png); }
.flex-con{
overflow: auto
}
</style>
</head>
<body>
<div id="wrap" class="flex-wrap flex-vertical">
<header>
<ul>
<li class="border-b active" ></li>
<li class="border-b" ></li>
<li class="border-b" ></li>
<li class="border-b" ></li>
<li class="border-b" ></li>
</ul>
</header>
<div id="main" class="flex-con">
</div>
<div id="footer" class="border-t">
<ul class="flex-wrap" >
<li tapmode="hover" onclick="randomSwitchBtn( this );" class="flex-con active" >晓雾</li>
<li tapmode="hover" onclick="randomSwitchBtn( this );" class="flex-con" >反馈</li>
<li tapmode="hover" onclick="randomSwitchBtn( this );" class="flex-con" >逗帆</li>
<li tapmode="hover" onclick="randomSwitchBtn( this );" class="flex-con" >动态</li>
<li tapmode="hover" onclick="randomSwitchBtn( this );" class="flex-con" >ME</li>
</ul>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="script/api.js"></script>
<script type="text/javascript">
apiready = function () {
$api.fixStatusBar( $api.dom('header') );
api.setStatusBarStyle({
style: 'dark',
color: '#3498DB'
});
var ajpush = api.require('ajpush');
ajpush.init(function(ret) {
if (ret && ret.status){
//别动老子的注释
}
});
funIniGroup();
}
function funIniGroup(){
var eHeaderLis = $api.domAll('header li'),
frames = [];
for (var i = 0,len = eHeaderLis.length; i < len; i++) {
frames.push( {
name: 'frame'+i,
url: './html/frame'+i+'.html',
bgColor : 'rgba(0,0,0,.2)',
bounces:true
} )
}
api.openFrameGroup({
name: 'group',
scrollEnabled: false,
rect: {
x: 0,
y: $api.dom('header').offsetHeight,
w: api.winWidth,
h: $api.dom('#main').offsetHeight
},
index: 0,
frames: frames
}, function (ret, err) {
});
}
// 随意切换按钮
function randomSwitchBtn( tag ) {
if( tag == $api.dom('#footer li.active') )return;
var eFootLis = $api.domAll('#footer li'),
eHeaderLis = $api.domAll('header li'),
index = 0;
for (var i = 0,len = eFootLis.length; i < len; i++) {
if( tag == eFootLis[i] ){
index = i;
}else{
$api.removeCls(eFootLis[i], 'active');
$api.removeCls(eHeaderLis[i], 'active');
}
}
$api.addCls( eFootLis[index], 'active');
$api.addCls( eHeaderLis[index], 'active');
api.setFrameGroupIndex({
name: 'group',
index: index
});
}
function openNewWindow(type) {
api.openWin({
name: type,
url: '../html/' + type + '.html',
pageParam: {},
bounces: false,
opaque: false
});
}
var ajpush = api.require('ajpush');
ajpush.init(function(ret) {
if (ret && ret.status){
//success
}
});
var ajpush = api.require('ajpush');
ajpush.setListener(
function(ret) {
var id = ret.id;
var title = ret.title;
var content = ret.content;
var extra = ret.extra;
}
);
var ajpush = api.require('ajpush');
var param = {alias:'myalias',tags:['tag1','tag2']};
ajpush.bindAliasAndTags(param,function(ret) {
var statusCode = ret.statusCode;
});
api.addEventListener({name:'pause'}, function(ret,err) {
var ajpush = api.require('ajpush');
ajpush.onPause();
});
</script>