登录

弹出没有任何反映

<!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>


# jQuery
hg199 hg199 1889 天前 1001 次浏览

全部回复(3) 我要回复

  • Time

    Time2019-02-20 17:37:02

    你好,在下方

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

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


    回复
    0
  • hg199

    是差了一个逗号

    hg199 · 2019-02-21 21:41:54
  • 取消 回复 发送