I am using a jquery function to open a dialog box, and I need to be able to change the height and the width of the box. I am wanting to pass it a parameter from within the DIV. I have looked at many different possibilities, but to no avail. Any ideas would be greatly appreciated.
$.fx.speeds._default = 1000;
$(function() {
$("#dialog").dialog({
autoOpen: false,
height: 300,
width: 500,
show: "drop",
hide: "drop"
});
$("#opener").click(function() {
$("#dialog").dialog("open");
return false;
});
});
Here is my Div.
<div id="dialog">
Some text here
</div>
According to the documentation you can make the window resizable, set a min/max height and width and set the height and width as options when calling the
.dialog()method.From the documentation:
Get or set the width option, after init.
It should be pretty simple to get whatever data or parameters you have stored in your div and pass it as an option to the
.dialog()method.Update:
From your comments, you want something like this:
The fiddle