简体   繁体   English

如何在jQuery UI对话框上移动关闭按钮?

[英]How do I move the close button on a jQuery UI dialog box?

I'd like to move the close button in the top right hand corner of the UI Titlebar away from the actual titlebar. 我想将UI标题栏右上角的关闭按钮从实际标题栏移开。 I've looked through the documentation and through other SO questions but can't find the solution. 我已经浏览了文档和其他SO问题,但是找不到解决方案。

Has anyone ever done this before. 以前有没有人做过。

nb I can remove the titlebar but that also removes the close button, similarly I can remove the close button or move it anywhere on the titlebar but not away from the titlebar. 注意,我可以删除标题栏,但是也可以删除关闭按钮,类似地,我可以删除关闭按钮或将其移动到标题栏上的任何位置,但不能远离标题栏。

Thanks 谢谢

You can do that. 你可以做到的。

button.ui-dialog-titlebar-close {
  top:60px !important; 
  z-index:99999;
}

Try it on JSFiddle too 也可以在JSFiddle上尝试

最后,我隐藏了标题栏和关闭按钮,并插入了关闭对话框的图像:-)

<img src="close-window.png" onclick="$('#dialog-learn').dialog('close');" style="float:right;">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM