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