|
var eFootLis = $api.domAll('.footerPart')
for (var i = 0; i < eFootLis.length; i++) {
$api.addEvt(eFootLis, 'click', function() {
randomSwitchBtn(this)
funIniGroup(this)
});
}
};
function funIniGroup(index) {
var content = $api.dom('.content').offsetHeight
var header = $api.dom('.header').offsetHeight
var height = content + header;
// var index = 0
api.openFrameGroup({
name: 'group',
scrollEnabled: false,
rect: {
x: 0,
y: 0,
w: api.winWidth,
h: height
},
index: index,
frames: [{
name: 'choose',
url: 'html/choose.html'
}, {
name: 'appraise',
url: 'html/appraise.html'
}, {
name: 'history',
url: 'html/history.html'
}, {
name: 'own',
url: 'html/own.html'
}],
}, function(ret, err) {
if (ret) {
var index = ret.index
if (index == 2) {
api.openFrame({
name: 'history',
url: 'html/history.html',
reload: true,
rect: {
x: 0,
y: 0,
w: api.winWidth,
h: height
},
});
}
if (index == 3) {
api.openFrame({
name: 'own',
url: 'html/own.html',
reload: true,
rect: {
x: 0,
y: 0,
w: api.winWidth,
h: height
},
});
}
} else {
}
});
}
// 随意切换按钮
function randomSwitchBtn(tag) {
if (tag == $api.dom('.footer div.chooseT')) return;
var eFootLis = $api.domAll('.footer div'),
index = 0;
for (var i = 0, len = eFootLis.length; i < len; i++) {
if (tag == eFootLis) {
index = i;
if (index == 0) {
$api.addCls(eFootLis, 'choose')
$api.css($api.dom(".footer"), "background:rgba(85,85,85,0)")
} else {
$api.addCls(eFootLis, 'chooseT')
$api.css($api.dom(".footer"), "background:rgba(85,85,85,1)")
}
} else {
$api.removeCls(eFootLis, 'choose');
$api.removeCls(eFootLis, 'chooseT')
}
}
$api.addCls(eFootLis[index], 'active');
api.setFrameGroupIndex({
name: 'group',
index: index
});
} |
|