jQuery UI对话框自动设置iframe宽度

我想问为什么jQuery UI对话框会自动将宽度设置为“自动”?

下面是我要构建一个对话框的iframe.

<iframe id="pklist3" class="ui-dialog-content ui-widget-content" frameborder="0" src="http://localhost/picker" style="width: 570; height: 410px; min-height: 0px;" scrolltop="0" scrollleft="0">

它有一个固定的宽度和高度.但每当我调用“对话框(‘打开’)”时,宽度就会自动变为“自动”.至于高度它设置为一些固定值(我猜它是由jQuery UI计算)

初始化对话框时,我已经设置了宽度和高度.
像这样:

var dg = {};
dg.title = this.title;
dg.autoOpen = false;
dg.modal = true;
dg.overlay = { 
opacity: 0.4,background: "#000" 
        };                              
dg.resizable = false;
$('#pklist3').dialog(dg); //iframe width is still fixed value up to this line

但在此之后:

$('#pklist3').dialog('open'); //iframe width gets "auto" automatically

这是一种已知行为吗?有没有办法我们可以自己定义iframe的宽度和高度?

PS.我正在使用jQuery UI 1.8.16和jQuery 1.6.2
当我启动对话框时,iframe的宽度不会改变.只有在我调用对话框后才会改变(‘打开’)

解决方法

如果其他人正在处理这个问题,并且在这文章中发现,就像我一样,我最终找到了一个适用于我的解决方案: http://enotacoes.wordpress.com/2012/04/19/setting-iframe-width-in-jquery-dialog/

基本上,您可以在iframe样式中设置最小宽度,而不是(或另外使用)宽度样式.

<iframe src="someurl" width="100%" height="100%" frameborder="0" 
        scrolling="no" style="min-width: 95%;height:100%;"/>

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...