javascript - 如何在一个页面中打开多个对话框?
问题描述
我试图在一个页面中打开多个对话框,里面有一个 iframe,以类似于浏览器窗口。
我在这里有一个例子:http: //jsfiddle.net/pxQ8j/770/
第一个图标在单击时会按我的意愿打开,但是第二个对话框不会,并且 div 内容保持未隐藏。
我也很好奇如何删除在调整对话框大小时显示的双滚动条。
先感谢您!!
代码:
<div class="icons">
<div id="draggable" class="icon1">
<div class="icons">
<a href="#"><img src="http://paynomind.us/wp- content/uploads/2018/06/polaroid-icon-02.png"></a></div>
<div class="iconTXT"> SS 18' </div>
</div>
<br>
<br>
<div id="draggable" class="icon2">
<div class="icons">
<a href="#"><img src="http://paynomind.us/wp- content/uploads/2018/06/hat-icon-03.png"></a></div>
<div class="iconTXT"> HATS </div>
</div>
<div id="gallery" title=“paynomind.us/files“>
<iframe src="paynomind.us/files"></iframe>
</div>
<div id= “hats” title="text">
<iframe src="paynomind.us/hats"></iframe>
</div>
iframe {
width: 100%;
height: 100%;
padding-right :0;
overflow: hidden;
}
.ui-dialog .ui-widget-header {
background: #D3D3D3;
border: 0;
color: black;
font-weight: normal;
font-family: Arial;
font-size: 12px;
margin: 1px 0;
}
.ui-dialog .ui-dialog-content {
overflow: auto;
position: relative;
padding: 0
margin: 0;
align-content: center;
height: auto;
width:auto;
}
.ui .dialog {
left: 0;
outline: 0 none;
padding: 0 !important;
position: absolute;
top: 0;
}
.ui .dialog ::-webkit-scrollbar { display: none; }
$( "#gallery" ).dialog({
autoOpen: false,
width:'700px',
resizeable: 'true',
modal: false,
margin: '0',
padding: '0'
});
$( "#hats" ).dialog({
autoOpen: false,
width:'700px',
resizeable: 'true',
modal: false,
margin: '0',
padding: '0'
});
$( '.icon1' ).click(function() {
$( "#gallery" ).dialog( "open" );
});
$( '.icon2' ).click(function() {
$( "#hats" ).dialog( "open" );
});
解决方案
推荐阅读
- python - 如果将 QThread 创建为局部变量,为什么 QThread 的行为会有所不同
- gatsby - netlify-cms git 提交未显示在网站上
- mysql - 需要有关查询性能的帮助
- python - 将 Python 程序设置为在一定天数后过期
- javascript - 表单JS提交成功后想要重定向到URL
- ffmpeg - ffprobe 以何种顺序为您提供帧信息?解码或演示顺序?
- android - SetupWithNavController 不适用于工具栏
- database - 如何使用 Neo4j 浏览器访问我自己的数据库
- react-native - 如何检查本机反应是否支持加速度计?
- python - access csv files in python