简体   繁体   English

仅在ModalDialog窗口中显示垂直滚动条?

[英]Show only Vertical scrollbar in ModalDialog window?

I am using following code to open a 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);
}

Here the property scroll provides only Yes and No option. 在此,属性滚动仅提供“是”和“否”选项。 I want only Vertical scroll bar and not Horizontal one. 我只需要垂直滚动条而不是水平滚动条。 How should I achieve this ? 我该怎么做到这一点?

Can anyone help me on this issue ? 任何人都可以帮我解决这个问题吗?

Make sure that the width of PopUp.aspx is not more than the dialogWidth:820px; 确保PopUp.aspx的宽度不超过dialogWidth:820px;

try this 尝试这个

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

on PopUp.aspx 在PopUp.aspx上

Have you tried the following: 您是否尝试过以下方法:

Specify the width to it: 指定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);
}

And depending upon your layout, you could use the css as well: 根据您的布局,您也可以使用CSS:

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

Source: stackoverflow 资料来源: stackoverflow

Please check this solution: 请检查以下解决方案:

did you make the div scrollable? 你让div可滚动了吗? ie

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

also make sure that you do not have any element (table, div, span) in the the div who's width is greater than the container width + 25px (needed for vertical scroll bar) 还要确保div中没有​​任何元素(table,div,span),宽度大于容器宽度+ 25px(垂直滚动条需要)

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM