gpt4 book ai didi

javascript - jQuery 对话框动态高度

转载 作者:行者123 更新时间:2023-11-27 22:35:19 24 4
gpt4 key购买 nike

我正在寻找一种使 jQuery UI 对话框高度根据内容动态变化的方法。

这是我的代码:

$( "#dialog-modal_"+productID ).html( "<iframe src='index.php?act=showProduct&amp;id="+productID+"' width='100%' height='100%' frameborder='0' scrolling='no'></iframe>" );

$( "#dialog-modal_"+productID ).dialog(
{
width: 810,
height: 590,
resizable: false,
modal: true,
open: function(event, ui)
{
}
});


有办法吗?

最佳答案

将高度更改为“自动”。参见 http://api.jqueryui.com/dialog/#option-height了解更多信息。

关于javascript - jQuery 对话框动态高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14185496/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com