0

如何设置 jquery ui 对话框的位置。当我在表单中单击完成时,对话框的位置位于页面顶部..

这是我如何调用对话框:

            <div id="dialog" style="display: none;">
                <h1>Transaction successful!</h1>
                <br />

                <h3>Thank you.</h3>
            </div>

    ScriptManager.RegisterStartupScript(this, this.GetType(), "showmessage", "jQuery('#dialog').dialog({ dialogClass: 'no-close',  title: 'Registration Successful', autoOpen: true,  height: 300, width: 600, modal: true, draggable: true, resizable: false, buttons: { Ok: function () { window.location.replace('Login.aspx'); } } }); ", true);

请帮忙...

4

1 回答 1

0

POSITION您可以为此使用可选参数:

$( ".selector" ).dialog({ position: { my: "left top", at: "left bottom", of: button } });

有关详细信息,请参阅http://api.jqueryui.com/dialog/#option-position

根据现有代码编辑示例:

 ScriptManager.RegisterStartupScript(this, this.GetType()
 , "showmessage"
 , "jQuery('#dialog').dialog({ 
   dialogClass: 'no-close'
   ,  title: 'Registration Successful'
   , autoOpen: true
   ,  height: 300
   , width: 600
   , modal: true
   , draggable: true
   , resizable: false
   , position: { my: "left top", at: "left bottom", of: button } //as per the jqueryUI example will need to customize for your needs.
   , buttons: { Ok: function () { window.location.replace('Login.aspx'); } } }); ", true);
于 2013-06-21T03:59:44.863 回答