弹出没有任何反映

【字号: 日期:2022-06-03浏览:49作者:雯心

问题描述

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Document</title>

<link rel="stylesheet" type="text/css" href="../static/plugins/layui/css/layui.css">

<script type="text/javascript" src="../static/plugins/layui/layui.js"></script>

<style type="text/css">

.header{width:100%; height:50px; background-color: #2e6da4; line-height: 50px;}

.header_conter{margin:0px auto; width:80px; height: 50px; background-color: #2e6da4;color:#fff; font-size: 21px;line-height:50px;display: block; border-color:#2e6da4;}

</style>

</head>

<body>

<div>

<button onclick="add1()">加表格</button> </div>

<script type="text/javascript">

layui.use(['layer'] function () {

layer=layui.layer;

$=layui.jquery;

})

function add1() {

layer.open({

type: 2,

title:'我的增加',

area:['480px','120px'],

content: 'add.html' ,

})

};

</script>

</body>

</html>

问题解答

回答1:

你好,在下方

layer.open({})中要添加 html文件的路径

比如我把文件这个html文件放在了suorg中 路径就是 content: 'suorg/aler.html'

相关文章: