Ja.Code 猿修地,时光机
致力于成为一位活用前端技术的嵌入式全栈工程师

UILite.Object Class Reference

2018-01-31
Jacob Pan

构造函数

Gallery({mContent: mParent: })

构造函数的参数与UILite.Object类一致,mContent可以是js数组对象

[
    new UILite.File(),
    <div>hello</div>
]

公共变量

mtBtnNext

页面Next按钮的Dom对象

mtBtnPre

页面Pre按钮的Dom对象

公共函数

getCurIdx()

获取当前显示页面的idx

setCurIdx(idx)

显示指定idx的页面

使用示例

创建实例

var myGallery = new UILite.Gallery();
myGallery.add(new UILite.File());
myGallery.add("<div>hello</div>");
myGallery.add(new UILite.Object("<div>world</div>"));

myGallery.setParent(document.body);
myGallery.show();

add()继承与UILite.Container。

构造函数完成所有初始化

var myGallery = new UILite.Gallery({
    mContent: [
        new UILite.File(),
        "<div>hello</div>",
        new UILite.Object("<div>world</div>"),
    ],
    mParent: document.body,
});

myGallery.show();

获取和设置idx

var idx = myGallery.getCurIdx();
myGallery.setCurIdx(2);

Jacob Pan ( jacobpan3g.github.io/cn )


Similar Posts

Comments