代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>开始使用 layui</title>
<link rel="stylesheet" href="./layui-master/dist/css/layui.css">
</head>
<body>
<button class="layui-btn" id="top">上边滑出</button>
<button class="layui-btn" id="bottom">下边滑出</button>
<button class="layui-btn" id="left">左边滑出</button>
<button class="layui-btn" id="right">右边滑出</button>
<script src="./layui-master/dist/layui.js"></script>
<script>
layui.extend({
layuiDrawer: './layuiDrawer'
}).use(['jquery', 'layuiDrawer'], function () {
var $ = layui.jquery
, layuiDrawer = layui.layuiDrawer;
$('#top').click(function () {
layuiDrawer.render({
offset: 't',
top: 30,
left: 30,
right: 30,
height: '300px',
content: "<div>上边滑出</div>",
});
});
$('#bottom').click(function () {
layuiDrawer.render({
offset: 'b',
bottom: 30,
left: 30,
right: 30,
height: '300px',
content: "<div>下边滑出</div>",
});
});
$('#left').click(function () {
layuiDrawer.render({
offset: 'l',
left: 30,
top: 30,
bottom: 30,
width: '300px',
content: "<div>左边滑出</div>",
});
});
$('#right').click(function () {
layuiDrawer.render({
offset: 'r',
right: 30,
top: 30,
bottom: 30,
width: '300px',
content: "<div>右边滑出</div>",
});
});
});
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。