我只在IE7中遇到了标题栏的宽度问题。第一个使用宽度打开的对话框函数:'auto'标题栏不会在整个对话框中延伸。使用minWidth的第二个函数可以工作,但其行为更像宽度属性,不会随内容大小增长。有任何想法吗?jQuery对话框IE7问题
不工作:
$(dialogId).dialog({
autoOpen: 'false',
modal: true,
draggable: false,
resizable: false,
buttons: buttons,
title: title,
width: 'auto',
open: function(){
/* IE HACK */
$buttonPane = $(this).next();
$buttonPane.find('button:first').addClass('accept').addClass('action');
$('.ui-dialog-titlebar-close').hide();
$('.ui-dialog').addClass('open_dialog');
$(this).css('overflow','hidden');// IE hack
onOpen;
},
close: function(){
$('.ui-dialog').removeClass('open_dialog');
afterClose;
}
});
工作(只固定宽度):
$('#conf_dialog').dialog({
dialogClass: dialogclass,
autoOpen: 'false',
modal: true,
draggable: false,
resizable: false,
buttons:buttons,
title:title,
minWidth: 255,
open: function(){
/* IE HACK */
$buttonPane = $(this).next();
$buttonPane.find('button:first').addClass('accept').addClass('action');
$('.ui-dialog-titlebar-close').hide();
},
close: afterClose
});
你有没有解决这个问题的运气?我遇到了完全相同的问题... – Jules 2011-08-18 12:12:42
宽度:auto不受支持:http://bugs.jqueryui.com/ticket/4437如果您查看API文档的宽度,具体只接受一种数字不是字符串/'汽车'。对于遇到此问题的其他人,如果尝试使用width:auto,则必须扩展/绑定到事件以自己调整标题大小。 – 2013-04-03 20:00:54