apicloud : openFrameGroup 使用

1111

<script type="text/javascript">
apiready = function () {
   goItemFrame( );  
}
 
function goItemFrame( ){
 
    api.openFrameGroup({ // 打开 frame 组
        name: 'group',
        scrollEnabled: false,
        rect: {
            x: 0,
            y: $api.dom('header').offsetHeight,
            w: api.winWidth,
            h: $api.dom('#main').offsetHeight
        },
        index: 0,
        frames:  
        [ 
         {
            name: 'report', 
            url: './html/report.html', 
            bounces:true, 
            vScrollBarEnabled:false,
            hScrollBarEnabled:false
         } 
         {
             name: 'center', 
            url: './html/center.html', 
            bounces:true, 
            vScrollBarEnabled:false,
            hScrollBarEnabled:false
        }]
    }, function (ret, err) {
         alert(ret.index); //获取当前切换到的索引值
         
         
         
    });
}

function randomSwitchBtn(tag,nm){
  
   var eFootLis = $api.domAll('#footer ul li');
   index = 0;
   for (var i = 0,len = eFootLis.length; i < len; i++) 
   {
       if( tag == eFootLis[i]){
           index = i;
       }else{
           $api.removeCls(eFootLis[i], 'active');
       }
   }
   $api.addCls( eFootLis[index], 'active');
   api.setFrameGroupIndex({
       name: 'group',
       index: index,//设置每次切换的索引
       scroll: true// 滚动切换
   });
   goItemFrame();
}
</script>

猜你喜欢

转载自www.cnblogs.com/xiaohuizhenyoucai/p/11364049.html