我正在使用以下代码打开ModalWindow:

function OpenPopup(rn) {
     var winargs = null;
     var winsettings = "help:no;status:no;maximize:yes;minimize:no;dialogHeight:450px;dialogWidth:820px;edge:sunken;scroll:yes;center:yes;resizable:yes;";
     winargs = window.showModalDialog("../PopUp.aspx?id=" + rn , winargs, winsettings);
}

在这里,属性滚动仅提供“是”和“否”选项。我只需要垂直滚动条,而不是水平的卷轴。我应该如何实现这一目标?

谁能在这个问题上帮我吗?

有帮助吗?

解决方案

确保popup.aspx的宽度不超过对话宽:820px;

尝试这个

<body style="width:820px;">

在popup.aspx上

其他提示

您是否尝试过以下操作:

指定 width 对此:

<a href="javascript:popupWindow('http://example/english/images/buttons/button_invoice.gif', 600"></a>
function popupWindow(url, width)
{
    window.open('url', 'win_name', 'width=' + width);
}

根据您的布局,您也可以使用CSS:

<style type="text/css">
  overflow-x:hidden;
</style>

资源: 堆栈溢出

请检查此解决方案:

您是否使Div滚动? IE

<div style="position:absolute;top:0;left:0;width:100px;height:100px;overflow:auto;"></div>

另外,请确保您在DIV中没有任何元素(表,div,跨度),其宽度大于容器宽度 + 25px(垂直滚动条需要)

http://forums.asp.net/t/1450847.aspx/1

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top