我有一个在中心弹出窗口的功能,我希望它有一个垂直滚动条。
function popUpCal()
{
var url = "calendar_flight_maint.php";
var width = 700;
var height = 600;
var left = parseInt((screen.availWidth/2) - (width/2));
var top = parseInt((screen.availHeight/2) - (height/2));
var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
window.open(url, "subWind", windowFeatures, "POS", "toolbar=no", "scrollbars=1");
}
我努力了scrollbars=yes
, scrollbars=auto
, scrollbars=1
但滚动条仍然没有出现。我的代码有问题吗?我使用的是 Firefox 21.0,并且已经在 IE 8 中进行了测试。问题出在哪里?
如规格所示窗口.打开 http://www.w3schools.com/jsref/met_win_open.asp,你的参数错误。
尝试这个:
function popUpCal()
{
var url = "calendar_flight_maint.php";
var width = 700;
var height = 600;
var left = parseInt((screen.availWidth/2) - (width/2));
var top = parseInt((screen.availHeight/2) - (height/2));
var windowFeatures = "width=" + width + ",height=" + height +
",status,resizable,left=" + left + ",top=" + top +
"screenX=" + left + ",screenY=" + top + ",scrollbars=yes";
window.open(url, "subWind", windowFeatures, "POS");
}
这里有一个jsFiddle http://jsfiddle.net/RienNeVaPlus/mWrEU/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)