-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
132 lines (121 loc) · 4 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
<!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">
<link rel="stylesheet" type="text/css" href="./css/aui.css" />
<style type="text/css">
.header {
padding: 0.5rem;
}
</style>
</head>
<body>
<header class="aui-bar aui-bar-nav aui-text-left header" id="header">
<a class="aui-btn aui-pull-right">
<i class="aui-iconfont aui-icon-menu"></i>
</a>
<a class="aui-btn aui-pull-right" tapmode onclick="openWin('xm_searchbar_win');">
<i class="aui-iconfont aui-icon-search"></i>
</a>
小陌阅读
</header>
<div class="aui-tab" id="xm-nav">
<div class="aui-tab-item aui-active" id="xm-nav1" tapmode onclick="randomSwitchBtn(this,0);">书架</div>
<div class="aui-tab-item" id="xm-nav2" tapmode onclick="randomSwitchBtn(this,1);">社区</div>
<div class="aui-tab-item" id="xm-nav3" tapmode onclick="randomSwitchBtn(this,2);">发现</div>
</div>
</body>
<script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript">
apiready = function(){
api.setStatusBarStyle({
style: 'light'
});
api.parseTapmode();
var header = $api.byId('header');
$api.fixStatusBar(header);
var headerPos = $api.offset(header);
var nav_h = $api.offset($api.byId('xm-nav')).h;
api.openFrameGroup ({
name: 'xm_nav_frmGrp',
scrollEnabled:true,
rect:{x:0, y:headerPos.h+nav_h, w:'auto', h:'auto'},
index:0,
preload:2,
frames:
[{
name: 'xm_bookshelf_frm',
url: './html/xm_bookshelf_frm.html',
bounces:true
},{
name: 'xm_community_frm',
url: './html/xm_community_frm.html',
bounces:false
},{
name: 'xm_find_frm',
url: './html/xm_find_frm.html',
bounces:false
}]
}, function(ret, err){
var nav = $api.byId('xm-nav');
var navAct = $api.dom(nav, 'div.aui-active');
$api.removeCls(navAct, 'aui-active');
var name = ret.name;
var index = ret.index;
if(index==0){
var nav1=$api.byId('xm-nav1');
$api.addCls(nav1, 'aui-active');
}else if(index==1){
var nav2=$api.byId('xm-nav2');
$api.addCls(nav2, 'aui-active');
}else if(index==2){
var nav3=$api.byId('xm-nav3');
$api.addCls(nav3, 'aui-active');
}
});
};
function randomSwitchBtn(obj, index) {
var nav = $api.byId('xm-nav');
var navAct = $api.dom(nav, 'div.aui-active');
$api.removeCls(navAct, 'aui-active');
$api.addCls(obj, 'aui-active');
api.setFrameGroupIndex({
name: 'xm_nav_frmGrp',
index: index
});
}
function openWin(name){
var delay = 0;
if(api.systemType != 'ios'){
delay = 300;
}
api.openWin({
name: ''+name+'',
url: './html/'+name+'.html',
bounces:false,
delay: delay,
slidBackEnabled:true,
vScrollBarEnabled:false
});
}
function openClub(){
var delay = 0;
if(api.systemType != 'ios'){
delay = 300;
}
api.openWin({
name: 'club_win',
url: './html/club_win.html',
bounces:false,
delay: delay,
slidBackEnabled:true,
vScrollBarEnabled:false,
progress:{
type:"page"
}
});
}
</script>
</html>