admin管理员组文章数量:1335363
I didn't find this in the documentation.
Should I just make the close button display:none
with css, or is there a clean way in the API to make a dialog without the X button (top-right)?
I didn't find this in the documentation.
Should I just make the close button display:none
with css, or is there a clean way in the API to make a dialog without the X button (top-right)?
- I'm pretty sure this is not possible to toggle via parameters. It makes no sense to provide dialogs without closing buttong/possibility. This wouldn't be good for usability reasons. If you need this for design purposes it's okay to do this via CSS. – Smamatti Commented Feb 1, 2012 at 9:39
- @Smamatti - the dialog is part of a wizard, where there's one way to proceed - and simply closing the dialog is not an option at this point. – ripper234 Commented Feb 1, 2012 at 9:41
- This is a duplicate of stackoverflow./questions/9093486/… – Barry Chapman Commented Feb 1, 2012 at 9:41
- Duplicate of stackoverflow./questions/896777/… – Chris Commented Feb 1, 2012 at 9:46
- @BarryChapman - wtf? No it really isn't. – ripper234 Commented Feb 1, 2012 at 9:46
3 Answers
Reset to default 6This may solve your Problem:
$("#dialogId").dialog({
closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close", ui.dialog).hide(); }
});
There is no option to disable the 'X' button. You would need to add css to display none/hide() the element with the class 'ui-icon-closethick' when it is loaded and opened.
For some reason .hide() did not work for me. This did:
$('#divMsg').dialog({ title: 'Please wait...',
modal: true,
closeOnEscape: false,
open: function (event, ui) { $(".ui-dialog-titlebar-close", ui.dialog).css('display', 'none'); } }).text('Text To Display').css('background', 'white');
This code snippet also shows how to set the title and text of the dialog box -- I am using it as a modal notification window and closing it when my AJAX call pletes.
本文标签: javascriptHow to make jqueryuidialog not have a close buttonStack Overflow
版权声明:本文标题:javascript - How to make jquery-ui-dialog not have a close button? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742269918a2444110.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论