$('.openDialog').click(function(event){
var width=$(this).attr('width');
var height=$(this).attr('height');
alert(width + ' ' + height);
event.preventDefault();
$("#dialog").dialog({autoOpen: false, modal: true});
$('#dialog').dialog('option', 'width', width);
$('#dialog').dialog('open');
$('#dialog p').load('http://pagetoload.com/page.html .content');
});
As you can see above i'm trying to open a dialog box with a passed in parameter of width and height, however when I try and pass in the value of width on this line:
$('#dialog').dialog('option', 'width', width);
it doesn't work, any ideas why or how to get around that?
Thanks