I am trying to create a dialogue using jQueryUI, and I ran into two problems that I did not expect, and did not find a solution that seems to work for me. Using this code:
$( '<div/>' ).load( $this.attr( 'href' ) ).dialog({ height: 'auto', maxWidth: 600, position: 'center', resizable: false, title: $this.attr( 'title' ).length > 0 ? $this.attr( 'title' ) : false, width: 'auto', resize: function( e, ui ) { $(this).dialog( 'option', 'position', 'center' ); } });
As a result, I get a dialog that is located in such a way that the upper left corner is in the center of the screen (or near it) and the width of which completely depends on the text that it contains. Is there something obvious that I'm missing? I would very much like the dialogue as a whole to be centered on both axes and the width should not exceed 600 pixels.
Thanks.
source share