layer插件如何弹出自定义div?
用了webuploader,想要点击按钮弹出文件上传窗口。即id=wrapper下的DIV<divid="wrapper"><divid="container"><!--...
用了webuploader,想要点击按钮弹出文件上传窗口。即id=wrapper下的DIV
<div id="wrapper">
<div id="container">
<!--头部,相册选择和格式选择-->
<div id="uploader">
<div class="queueList">
<div id="dndArea" class="placeholder">
<div id="filePicker"></div>
<p>或将照片拖到这里,单次最多可选300张</p>
</div>
</div>
<div class="statusBar" style="display:none;">
<div class="progress">
<span class="text">0%</span>
<span class="percentage"></span>
</div><div class="info"></div>
<div class="btns">
<div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
layer.open({
type: 1,
area: ['600px', '360px'],
shade: false,
title: false,
skin: 'yourclass',
content:
});
</script>
content:怎么写? 展开
<div id="wrapper">
<div id="container">
<!--头部,相册选择和格式选择-->
<div id="uploader">
<div class="queueList">
<div id="dndArea" class="placeholder">
<div id="filePicker"></div>
<p>或将照片拖到这里,单次最多可选300张</p>
</div>
</div>
<div class="statusBar" style="display:none;">
<div class="progress">
<span class="text">0%</span>
<span class="percentage"></span>
</div><div class="info"></div>
<div class="btns">
<div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
layer.open({
type: 1,
area: ['600px', '360px'],
shade: false,
title: false,
skin: 'yourclass',
content:
});
</script>
content:怎么写? 展开
展开全部
刚好今天我也遇到这个问题,摸索了几个小时,搞定了,关键语法如下:
layer.open({
type: 1,
content: $('#id') //这里content是一个DOM,这个元素要放在body根节点下
});
所以你这个就应该是:
content: $('#wrapper')
实例:
<!DOCTYPE HTML><html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="jquery-1.9.1.min.js"></script>
<script src="layer/layer.js"></script>
<script>
$(function () {
$("a").click(function () {
layer.open({
type: 1,
closeBtn: false,
shift: 2,
shadeClose: true,
content: $("#box1")
});
})
})
</script>
<style>
*{padding:0; margin: 0;}
#box1{width:555px; height:600px; background: #eee; display:none;}
</style>
</head>
<body>
<a href="#">点击</a>
<div id="box1">
111
</div>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询