Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 JQuery 对话框大小设置为窗口大小?
我尝试使用“自动”,但这只是使其大小适合其元素,而且我不想指定 px 的确切 b/c 不会是动态的。谢谢!
我在这里进行了一些猜测,但是您可以使用以下方法获取窗口的大小:
var windowWidth = $(window).width(); var windowHeight = $(window).height();
所以,我会接受它,并将该值传递给 jQuery 对话框。
$( ".dialog" ).dialog({ height: windowHeight, width: windowWidth });