Apicloud学习第一天

Apicloud学习   

apiready = function() {}  //dom加载完后执行

api.openWin({ //打开新的window

          name: 'main', //window名字

          url: './html/main.html', //window路径

          pageParam: { //传递window参数

              name: 'main'

          }

      });

main.html页面接收window参数写法:api.pageParam.wraeId;

$api.domAll (nav,’menu’) //获取所有nav下类为menu的元素

$api.byId(‘header’) //获取idheader的元素

$api.fixStatusBar(header) //获取header并加上状态栏

$api.offset(header).h //通过偏移量获取高度

api.openFrameGroup ({ //frame组合

            name: 'mainFrameGroup',//frame组合名称

            scrollEnabled: true,//是否开启滚动

            rect: {

                 x: 0, //x轴坐标

                 y: headerH+navH,//y轴坐标

                 w: 'auto', //自适应宽度

                 h: 'auto'//自适应高度

            },

            index: 0,//索引值

            frames: frames //添加frames板块

        }, function(ret, err){//回调函数

            

        });

$api.addCls(selecter,’’)//给元素添加样式

$api.removeCls(selecter,’’)//给元素删除样式

 api.setFrameGroupIndex({ //设置frame组当前可见的frame

            name: 'mainFrameGroup',//frame的名字

            index: index_,//frame的索引值

            scroll: true//是否平滑滚动

        });

Api.winHeight  //获取设备屏幕高度

原文地址:https://www.cnblogs.com/xiaojianwei/p/10594843.html