Layer 使用

官網文檔 http://layer.layui.com/mobile/api.htmlcss

1.須要添加jquery的引用而後是html

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

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

 

封裝的部分代碼。ui

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(); //瘋狂模式,關閉全部層
};

調用代碼spa

 layer_tip('請選擇操做環節!');code

Layer_Loding() ;
Layer_closeAll();htm

相關文章
相關標籤/搜索