SharePoint 2010错误的弹出对话框大小

问题描述 投票:0回答:1

我正在将SharePoint 2007 Web应用程序的外观更新为SharePoint 2010。

用于新项目,编辑等的弹出对话框具有固定宽度和高度的嵌入式样式,这让我感到惊讶。如下所示,div.ms-dlgContent,.ms-dlgBorder,.ms-dlgTitle和iframe.ms-dlgFrame都具有固定的内联宽度设置。]

<div class="ms-dlgContent" role="dialog" aria-labelledby="dialogTitleSpan" tabindex="-1" style="z-index: 1505; display: block; width: 502px; height: 518px; left: 699.5px; top: 10px;">
  <div class="ms-dlgBorder" style="width: 500px; height: 516px;">
    <div class="ms-dlgTitle" style="width: 500px;">...</div>
    <div class="ms-dlgFrameContainer">
      <iframe id="GUID" class="ms-dlgFrame" src="/_layouts/listform.aspx?ListId=GUID" frameborder="0" style="width: 500px; height=484px;">...</iframe>
    </div>
  </div>
</div>

我可以在浏览器开发人员工具中使用jquery访问和更新div和iframe:

$('.ms-dlgContent').css('width','');
$('.ms-dlgBorder').css('width','');
$('.ms-dlgTitle').css('width','');
$('.ms-dlgFrame').width('');

但是我认为这不是解决问题的适当方法。我应该尝试让SharePoint 2010在对话框打开时正确调整其大小。

由于样式是内联的,因此无法用我的自定义css文件覆盖它。

[我已经尝试过将jquery放在我的母版页中,并尝试使用document.ready(...)更新listform.aspx页,但是当然,它们都不起作用(正如我所期望的。

任何人都可以通过以下方式为我提供帮助,即如何使SharePoint正确地使用css调整弹出对话框的大小,或者可以在其中放置我的jquery来调整弹出对话框的大小?

提前感谢。

我正在将SharePoint 2007 Web应用程序的外观更新为SharePoint2010。新项目,编辑等的弹出对话框具有固定宽度和...的内联样式。]] >

我们可以使用CSS !important

覆盖默认CSS样式。以下样式供您参考。
<style type="text/css">
.ms-dlgContent{
    width:800px !important;
    height:500px !important;
    top:120px !important;
}
.ms-dlgBorder{
    width:800px !important;
    height:500px !important;
}
.ms-dlgTitle{
    width:800px !important;
}
.ms-dlgFrameContainer{
    width:800px !important;
    height:500px !important;
}
.ms-dlgFrame{
    width:800px !important;
    height:497px !important;
}
</style>

如果您不想使用列表中的默认弹出对话框,我们可以转到“列表设置”->“高级设置”,然后将“ 在对话框中启动表单?”设置为“

”。

enter image description here

jquery css sharepoint sharepoint-2010
1个回答
0
投票

我们可以使用CSS !important

© www.soinside.com 2019 - 2024. All rights reserved.