Guest User

Untitled

a guest
Aug 20th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. jQueryUI Dialog Position and Size
  2. $( '<div/>' ).load( $this.attr( 'href' ) ).dialog({
  3. height: 'auto',
  4. maxWidth: 600,
  5. position: 'center',
  6. resizable: false,
  7. title: $this.attr( 'title' ).length > 0 ? $this.attr( 'title' ) : false,
  8. width: 'auto',
  9. resize: function( e, ui ) {
  10. $(this).dialog( 'option', 'position', 'center' );
  11. }
  12. });
  13.  
  14. $( '<div/>' ).attr('id', 'my-dialog').load( 'hello.html' ).dialog({
  15. height: 'auto',
  16. maxWidth: 600,
  17. minWidth: 500,
  18. position: 'center',
  19. resizable: false,
  20. title: $this.attr( 'title' ).length > 0 ? $this.attr( 'title' ) : false,
  21. });
  22.  
  23. $(window).resize(function(){
  24. $('#my-dialog').dialog( 'option', 'position', 'center' );
  25. });
Add Comment
Please, Sign In to add comment