美文网首页
Frame切换-ApiCloud

Frame切换-ApiCloud

作者: QinHaolei | 来源:发表于2019-11-04 21:15 被阅读0次
        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

          本文链接:https://www.haomeiwen.com/subject/dwkjbctx.html