I want to ask why jQuery UI dialog is setting the width to \"auto\" automatically?
Below is my iframe to be constructed a dialog.
<iframe src="<%= AppConfig[:running_url] %>" frameborder="0" scrolling="no"></iframe>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$("iframe").height($(window).height());
$("iframe").width($(window).width());
});
</script>
I think scrolling="no"
is necessary.
You can define the element width
on init :
$('#something').dialog({
width: '100px'
});
In case anyone else is dealing with this issue and stumbles upon this post, as I did, I eventually found a solution that worked for me at: http://enotacoes.wordpress.com/2012/04/19/setting-iframe-width-in-jquery-dialog/
Basically, you set the min-width in the iframe style instead of (or additionally with) the width style.
<iframe src="someurl" width="100%" height="100%" frameborder="0"
scrolling="no" style="min-width: 95%;height:100%;"/>