|
是把所有的方法都包进去吗?
apiready = function() {
$api.fixStatusBar($api.dom('header'));
api.setStatusBarStyle({
style: 'dark',
color: '#6ab494'
});
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) {
index = i;
} else {
$api.removeCls(eFootLis, 'active');
$api.removeCls(eHeaderLis, 'active');
}
}
$api.addCls(eFootLis[index], 'active');
$api.addCls(eHeaderLis[index], 'active');
api.setFrameGroupIndex({
name: 'group',
index: index
});
}
}
我这样弄的,提示切换按钮那个未定义了,刚学习这个,指教指教谢谢 |
|