Jquery Dialog window size

14,404

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 });
Share:
14,404
slandau
Author by

slandau

Updated on July 09, 2022

Comments

  • slandau
    slandau almost 2 years

    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 don't want to specifiy the px's exactly b/c that won't be dynamic. thanks!