|
function funIniGroup() {
var eHeaderLis = $api.domAll('header li')
var frames = [];
for (var i = 0, len = 5; i < len; i++) {
frames.push({
name : 'frame' + i,
url : './html/frame' + i + '.html',
bgColor : '../image/bg.png',
bounces : false//是否允许下拉
})
}
api.openFrameGroup({
name : 'group',
scrollEnabled : false,
rect : {
x : 0,
y : 0,
w : api.winWidth,
h : $api.dom('#main').offsetHeight
},
index : 0,
frames : frames,
background : '../image/201151074252624.jpg',
preload : 3,
scrollEnabled : true//允许左右滑动
}, function(ret, err) {
var name = ret.name;
var index = ret.index;
ChangeBar(index);
});
}
//切换自动
function ChangeBar(index) {
var eFootLis = $api.domAll('#footer li'), eHeaderLis = $api.domAll('header li');
for (var i = 0, len = eFootLis.length; i < len; i++) {
if (index != i) {
$api.removeCls(eFootLis, 'active');
$api.removeCls(eHeaderLis, 'active');
}
}
$api.addCls(eFootLis[index], 'active');
$api.addCls(eHeaderLis[index], 'active');
// api.setFrameGroupIndex({
// name : 'group',
// index : index
// });//我的问题就是在这里
}
// 随意切换按钮
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
});//我的问题就是在这里
} |
|