<div id="drawer">
<div id="side" style="display:none;">
<i class="layui-icon layui-icon-set" id='tig'></i>
</div>
layui.config({
base: './js/'
}).extend({
drawer: 'layDrawer'
});
layui.use(['drawer'], function () {
var drawer = layui.drawer;
drawer.render({
//trigger和elem只能為id
trigger: '#tig'
, elem: '#side'
//top bottom left right 默認為left
, position: 'right'
//默認為230 可以填百分比
, specs: '230'
, open: function () {
layer.msg("打開")
}
, close: function () {
layer.msg("關(guān)閉")
}
});
});