Layer 使用

官网文档 http://layer.layui.com/mobile/api.html

1.需要添加jquery的引用然后是

loadExtentFile("css", "/plugin/layer_mobile-2.0/need/layer.css");

loadExtentFile("js", "/plugin/layer_mobile-2.0/layer.js");
loadExtentFile("js", "/plugin/layer_mobile-2.0/layerBLL.js");

封装的部分代码。

function layer_tip(content) {
    layer.open({
        content: content
        , skin: 'msg'
        , anim: 'scale'        
        , time: 1 //2秒后自动关闭

        , style: ' position: inherit;  left: auto;'

    });
};

function Layer_Loding(content ='请稍后') {
    layer.open({
        content: content
        , type: 2
        //, skin: 'msg'
        //, anim: 'scale'
        //, time: 1 //2秒后自动关闭
        , shadeClose: false
        , style: ' position: inherit;  left: auto;'

    });
    
};

;function Layer_closeAll() {

    layer.closeAll(); //疯狂模式,关闭所有层
};

调用代码

 layer_tip('请选择操作环节!');

Layer_Loding() ;
Layer_closeAll();

猜你喜欢

转载自www.cnblogs.com/Blogs-Wang/p/10792092.html
今日推荐