Javascript Jquery.load displaces对话框

Javascript Jquery.load displaces对话框,javascript,jquery,Javascript,Jquery,我对对话框中的Jquery加载有问题 我花了一整晚的时间试图弄明白为什么当我加载另一个文件时对话框会移到屏幕的右侧。显然,加载不同的页面会随机影响它。它可以是中心,但在最底部,但我不知道为什么会发生。我所知道的是,将另一页加载到对话框中会将对话框从中间移开 这是我的代码: <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> &l

我对对话框中的Jquery加载有问题

我花了一整晚的时间试图弄明白为什么当我加载另一个文件时对话框会移到屏幕的右侧。显然,加载不同的页面会随机影响它。它可以是中心,但在最底部,但我不知道为什么会发生。我所知道的是,将另一页加载到对话框中会将对话框从中间移开

这是我的代码:

<html>
<head>
    <script src="http://code.jquery.com/jquery-latest.js"></script> 
    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.3/themes/ui-lightness/jquery-ui.css" type="text/css" media="all" />
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/jquery-ui.min.js"  type="text/javascript"></script>
    <script src="http://jquery-ui.googlecode.com/svn/tags/latest/external/jquery.bgiframe-2.1.1.js" type="text/javascript"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/i18n/jquery-ui-i18n.min.js"   type="text/javascript"></script>

    <script src="ProfilePage/jqueries.js"></script>           

    <script type="text/javascript">
        $(
            function()
            {
               $("#box").load("jquery1.html").dialog({modal:true,height:400,width:400});          
            }            
        )         
    </script>
</head>

<body>

    <div id="parent" style="background-color:red;height:800px;width:800px;">
        <div id="circle" style="position:relative;left:0px;height:800px;width:400px;background-color:green;float:left;">
        </div>
       <div id="box">
            I want milk
        </div>
        <div id="sds" style="position:relative;float:left;left:5px;height:800px;width:399px;background-color:yellow;">
        </div>
    </div>

</body>
</html>

$(
函数()
{
$(“#box”).load(“jquery1.html”).dialog({modal:true,高度:400,宽度:400});
}            
)         
我想要牛奶
如果我删除加载,只在div中放入一个普通文本,它就可以正常工作。
有人能提出一个主意吗?谢谢

试着将其添加到新行中即可

 $("#box").load("jquery1.html")
 $("#box").dialog({modal:true,height:400,width:400});          

谢谢你的回复,但是没有用。它仍然会将对话框移动到屏幕的右角。调用load会移动原始文件中的内容。div是相对的。。