Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resize width of a Jquery dialog after initialization

I'm trying to change the width of a JQuery dialog after it has been initialized. Here is my initialization:

$(function() {
$("#dialogContainer").dialog({
title: 'Some title',
resizable: false,
bgiframe: true,
overlay: { opacity: 0.3, background: "white" },
position: [200, 200],
autoOpen: false,
height: 150,
width: 'auto'
modal: true,
buttons: {
  'ok': function() {
    $(this).dialog('close');
  }
}

});

});

And this is what I am doing to change the width of it in some other function:

$("#dialogBox").dialog('option','width',700);

But this doesn't work. The width of the dialog is the width of the paragraph that's first displayed in it. Was I suppose to do anything else?

Here is the html for the dialog:

<div id = 'dialogContainer'>
  <p id = 'message'></p>
</div>
like image 906
Draco Avatar asked May 18 '09 12:05

Draco


1 Answers

Make sure that you are using ui.resizable.js and ui.resizable.css

like image 168
kgiannakakis Avatar answered Oct 19 '22 17:10

kgiannakakis