Frame切换-ApiCloud

    function fnOpenFramegroup() {
        if (api.systemType == 'ios') {
            api.setStatusBarStyle({
                style: 'dark'
            });
        }
        $api.addCls(orderHead, 'on');
        headerHeight = $api.offset(header).h;
        api.openFrameGroup({
            name: 'order_framegroup',
            rect: {
                x: 0,
                y: headerHeight,
                w: 'auto',
                h: api.winHeight - footerHeight - headerHeight
            },
            scrollEnabled: true,
            frames: [{
                name: 'order_frame_0',
                url: 'order_frame_0.html',
                vScrollBarEnabled: false,
                hScrollBarEnabled: false,
                bounces: false
            }, {
                name: 'order_frame_1',
                url: 'order_frame_1.html',
                vScrollBarEnabled: false,
                hScrollBarEnabled: false,
                bounces: false
            }]
        }, function(ret, err) {
            if (ret) {
                changeGroup(ret.index, true)
                    // alert(JSON.stringify(ret));
            } else {
                // alert(JSON.stringify(err));
            }
        });
    }

    var orderTitles = $api.domAll('#orderHead', '.titles');
    
    function changeGroup(index, bull) {
        for (var i = 0; i < orderTitles.length; i++) {
            if (index == i) {
                $api.addCls(orderTitles[index], 'active');
            } else {
                $api.removeCls(orderTitles[i], 'active');
            }
        }
        if (bull) {
            return;
        } else {
            api.setFrameGroupIndex({
                name: 'order_framegroup',
                index: index,
                scroll: true
            });
        }
    }

你可能感兴趣的:(Frame切换-ApiCloud)