2

我有一个自定义对话框,现在我需要将自定义对话框定位到所需位置,如何在 .html.erb 文件中执行此操作?

4

1 回答 1

1

With the widget .dialog() jQuery UI provides an option to change the position of your dialog box.

Using it is as simple as : $("#selector").dialog({position:"center"}); // center is default value

or later with $("#selector").dialog("option","position","center");

Possible values :

  • a single string representing position within viewport: 'center', 'left', 'right', 'top', 'bottom'.
  • an array containing an x,y coordinate pair in pixel offset from left, top corner of viewport (e.g. [350,100])
  • an array containing x,y position string values (e.g. ['right','top'] for top right corner).
于 2012-08-16T10:29:49.753 回答