帖子
帖子
用户
博客
课程
123
返回列表 发新帖
3
帖子
0
勋章
60
Y币
我也碰到了这个问题了,我是这样解决的
api.setFrameGroupIndex({
                        name : 'group',
                        index : index
                });
原先在openframegroup的回调事件和onclick事件都写了这个切换的方法,现在在回调事件里面注释掉这个方法就OK了
7
帖子
0
勋章
78
Y币
牧童骑黄牛 发表于 2016-8-30 14:02
我也碰到了这个问题了,我是这样解决的
api.setFrameGroupIndex({
                        name : 'group',

可以贴个代码看看吗?我不是很懂你的意思,是把
api.setFrameGroupIndex({
                        name : 'group',
                        index : index
                });删了吗
3
帖子
0
勋章
60
Y币
guozhi 发表于 2016-8-30 16:54
可以贴个代码看看吗?我不是很懂你的意思,是把
api.setFrameGroupIndex({
                        name ...

        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
                });//我的问题就是在这里
        }
89
帖子
1
勋章
978
Y币

把你代码贴贴,有可能是你写切换函数的时候,index没有设置好
123
您需要登录后才可以回帖 登录

本版积分规则