Dialog content width

by petersendidit

HTML

<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="https://raw.githubusercontent.com/jquery/jquery-simulate/master/jquery.simulate.js"></script>
<div id="dialog" title="Basic dialog">
	<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>

JavaScript

var dialog = $( "#dialog" ).dialog({
    resize: function( event, ui) {
        var parent = dialog.parent();
        var width = parent.width();
        if (dialog.outerWidth(true) != width) {
            console.log( dialog.outerWidth(true), width );
        }
    }
});