【发布时间】:2015-11-23 07:32:07
【问题描述】:
使用 JQueryUI 模态对话框时,关闭按钮会自动聚焦,引导通过 jquery 工具提示显示的标题。我不希望模态中的任何内容都被关注。我曾尝试在模态窗口的标题上添加点击触发器,但似乎没有效果。
请帮帮我。
<script src="https://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script>
$(function() {
$( "#dialog" ).dialog({
width : 710,
height : 410,
modal: true,
resizable: false,
draggable: false
});
});
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css">
.ui-dialog-titlebar {
height: 15px;
}
iframe {
position: absolute;
top: 50%;
margin-top: -170px;
left: 50%;
margin-left: -340px;
}
html, body {
margin: 0;
padding: 0;
height: 100%;
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Dialog - Default functionality</title>
</head>
<body>
<div class="modal"></div>
<div id="dialog" title=" ">
<iframe style="position:absolute;Left:150" frameborder="0" scrolling="no" width="670" height="350" src="popUp.html" ></iframe>
</div>
</body>
</html>
【问题讨论】:
-
你的 popup.html 源代码在哪里?
-
你可以使用任何html页面代替popUp.html
-
@NarendrakumarM html popUp.html 没关系..
-
是的。我知道。这就是为什么我不在这里发布它。