日期:2014-05-16  浏览次数:20428 次

jquery ui dialog 怎么设置 才能居中 ?
用jquery ui ,做登录框 ,但是却不会居中。请问该怎么设置 啊?

固定在了左上角。
代码如下:
用的是 jquery-ui-bootstrap
index.html 
 
      <script src="{{ static_url('js/jquery-1.8.3.min.js') }}" ></script>
      <script src="{{ static_url('js/jquery-ui-1.8.16.custom.min.js') }}" ></script>
      <script src="{{ static_url('js/global.js') }}" ></script>

      <link href="{{ static_url('css/custom-theme/jquery-ui-1.8.16.custom.css') }}" rel="stylesheet" />
      <link href="{{ static_url('bootstrap/bootstrap.css') }}" rel="stylesheet">

<a id="login-dialog" href="javascript:;">{{_('Login in ')}}</a>
 <div id="auth-form" style="display:none;margin:auto;" title="用户登陆">
   <p class="validateTips" style="height:20px">所有项为必填.</p>
<form action="">
  <fieldset>
        <br />
<label for="name">登陆名:</label>
<input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all" /><br /><br />
<label for="password">密 码:</label>
<input type="password" name="password" id="password" class="text ui-widget-content ui-corner-all" /><br /><br />
  </fieldset>
</form>
  </div>



js:

var login_dialog = $(function() {
        var email = $( "#email" ),
            password = $( "#password" ),
            allFields = $( [] ).add( email ).add( password );
        $("#auth-form").dialog({
            autoOpen: false,
            height: 'auto',
            width: 400,
            modal: true,
            stack:true,
            title:"登录窗口",
            buttons: {
                "登陆": function() {
                    $.ajax({
                          url: "/account/login/",
                          type: "POST",