脚本
<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=acc_like;
window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
return false;
}
//-->
</SCRIPT>
HTML
<BODY onLoad="popup('autopopup.html', 'ad')">
我收到弹出窗口,但我不希望它在用户点击窗口之外时最小化。
最佳答案
在我看来你应该使用 jquery dialog要得到你想要的,下面的示例(在 jsFiddle 上试试):
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$( "#dialog-form" ).dialog({
modal: true <!-- is background page responsive or not -->
});
});
</script>
</head>
<body>
Background information
<div id="dialog-form" title="Hello">Basic information</div>
</body>
</html>
关于javascript - 如何将弹出窗口附加到页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17378844/