码迷,mamicode.com
首页 > 其他好文 > 详细

Layer 使用

时间:2019-04-29 19:06:05      阅读:373      评论:0      收藏:0      [点我收藏+]

标签:close   jquery   sha   query   osi   封装   关闭   eal   添加   

官网文档 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();

Layer 使用

标签:close   jquery   sha   query   osi   封装   关闭   eal   添加   

原文地址:https://www.cnblogs.com/Blogs-Wang/p/10792092.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!