css - Centering jQuery Modal Dialog Popup -


im trying show modal dialog/popup when users visit homepage.

i able show dialog, not appear in center of screen.

i importing these files, in case issue:

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>  <script language="javascript" type="text/javascript">  $(function () {      $("#dialog-modal").dialog({      width: 'auto',     // position: 'center',     center: true,      modal: true,      autooption: true,      resizable: false      });  });  </script>  <div id="dialog-modal" title="offer" style="text-align:center"><img alt="" src="pack.jpg"/> </div> 

my fiddle: http://jsfiddle.net/szepb/

thanks

try uncommenting // position: 'center',

or if not work try below code.hope meant.. :)

$('body').dialog('option', 'position', 'center'); 

if need center in @ particular selector try

$('your_selector').dialog('option', 'position', 'center'); 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -