我正在尝试使用下面的按钮打开一个弹出窗口。
<form>
<button onClick="OpenPopupCenter('test.php','Name',700,500)">Test Button</button>
</form>
函数“ OpenPopupCenter”是为居中弹出窗口而创建的脚本。请参见下文。
<script language="javascript" type="text/javascript">
function OpenPopupCenter(pageURL, title, w, h) {
var left = (screen.width - w) / 2;
var top = (screen.height - h) / 4; // for 25% - devide by 4 | for 33% - devide by 3
var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
}
</script>
当弹出窗口打开时,我想禁用滚动功能吗?
答案 0 :(得分:2)
尝试将其添加到test.php
文件中。
body {
overflow-x: hidden;
overflow-y: hidden;
}