2010-09-28 74 views

回答

8

你是正确的,.position()是走在这里,像这样的方式:

​$("#dialog").dialog() 
      .parent() //remember .dialog() wraps the content in another <div> 
      .position({ my: 'center', at: 'center', of: '#parent' }); 
    //or just .position({ of: '#parent' }); 

在上面的#parent它的父元素选择,you can give it a try here。你想要myat性质是center所以他们集中彼此的运算上面,那么of选择是父选择你想在中心。

我指定了图中所有的相关选项,但由于centermyat的默认值,您可以指定只需of就像我在上面的注释行中所述。

+0

你让它看起来很简单!谢谢:) – Skilldrick 2010-09-28 19:30:08

+2

这些选项很有用,因为我在实验后意识到我实际上需要'我':'top'',因为如果对话框太大,顶部会从顶部消失浏览器)。 – Skilldrick 2010-09-28 19:33:28

+0

@Skilldrick - 我想知道他们是否会对我有所帮助,我想更多的是为未来的用户找到这个,但他们帮助你,以及优秀的:) – 2010-09-28 19:36:18

相关问题