开发者

Jquery Dialog window size

开发者 https://www.devze.com 2023-02-17 05:16 出处:网络
How do I make a JQuery dialog size to the size of the window? I tried using \'auto\' but that just makes it size to its elements, and I d开发者_开发百科on\'t want to specifiy the px\'s exactly b/c th

How do I make a JQuery dialog size to the size of the window?

I tried using 'auto' but that just makes it size to its elements, and I d开发者_开发百科on't want to specifiy the px's exactly b/c that won't be dynamic. thanks!


I'm taking a little bit of a guess here, but you can get the size of the window using:

var windowWidth = $(window).width();
var windowHeight = $(window).height();

So, I would take that, and pass that value to the jQuery Dialog.

$( ".dialog" ).dialog({ height: windowHeight, width: windowWidth });
0

精彩评论

暂无评论...
验证码 换一张
取 消