How to hide the close button of a dialog jQuery UI

While waiting for the official release of jQuery UI 1.7 (Yeah, the jQuery development team decided that it will release as version 1.7, due to confusion), which may be one option to remove the close button of a box, here's how quickly resolve the problem with the current 1.6rc6:

1
2
3
4
/ / Acting event open dialogue
) . dialog ( { $ ('# MyDialog'). Dialog ({
function ( ) { $ ( '.ui-dialog-titlebar-close' ) . css ( 'display' , 'none' ) ; } open: function () {$ ('. ui-dialog-titlebar-close'). css ('display', 'none');}
});

5 comments to "How to hide the close button of a dialog jQuery UI"

  1. March 16, 2009 joseph:

    Hi. I would like to ask for help.
    I just started learning jquery.
    I want to make a small function, such as that used in Flash galleries, to open a dialog box and darken the background. My goal is this:
    I have a button (picture) that allows you to download a pdf. I would like to open a dialog that darkens the rest, and are advised to wait while downloading the pdf. How can I do??
    Thank you for your help.
    joseph

  2. March 16, 2009 Giovambattista Fazioli :

    @ Giuseppe: in this case I think that you can not do exactly what you ask. First of all you are not "charging" a pdf, as could be the case of an image, but you do download users. Some, in fact, may choose to save it to disk others, however, may choose to open it, in fact I replaced with the content of your web page pdf.
    Apart from that, you would not, however, so you know when the pdf has been "downloaded" completely! So any dialog will remain open for eternity.
    Also, when downloading a file (as in your case), we think the browser to display the progress of your downloads and any message would be redundant.
    Let me know if I understood the question and if you have other questions.

  3. March 16, 2009 joseph:

    Hello and thanks for the bargain super fast response.
    In fact, you're right, and maybe I have not been clear;-p.
    So, the fact is this:
    I have already made any application in java2ee, jsp, and allows you to download the pdf by pressing the pulzante. Indeed automatically lets the user choose whether to open or save the pdf externally.
    So far, so OK. Now I need (waiting time variables, and some users tap again several times in spite of the progress of the download the browser), forcing them to wait for the user to completely obscuring the background, as I have seen allows dialog.
    My need is this: display the dialog and close it when you see the window (or choose save). I hope I helped and if it is possible to use jQuery (since I'm studying now) or do otherwise. With the bargain
    Joseph

  4. March 16, 2009 Giovambattista Fazioli :

    @ Joseph: ok, if you want we can divide the problem into two: open a dialog or darken the background, and intercept the downloading of the pdf. For the first problem the solution is quite simple, if you want, does not necessarily require jQuery. , inizialmente impostato invisibile display:none e in posizione assoluta position:absolute con il background a qualsiasi colore tu voglia e renderlo visibile al momento opportuno. To create a darkening effect, you can use a simple technique, or to insert a div (measuring 100%) immediately after the tag body , initially set invisible display:none and absolute position position:absolute with the background to any color you want and make it visible at the appropriate time. By setting an alpha then you create the proper effect of shading you want.
    As for the problem of interception of the opening dialogue of the browser I think, that for security reasons, it is not really possible. However, it is interesting topic and try to look around if there is any way to tell if the dialogue sdi downloading "is" to be opened ...

  5. March 19, 2009 joseph:

    Hello. Thanks for the clarification. I'm testing your idea, which seems to work. I wanted to ask one little thing: You can use the onLoad () on the same div? in practice so when it is invoked (charged) page finestra.O I suggest you close the other. The important thing to happen automatically without tap again.
    As regards the second part, servlets, etc., to manage the entire process, from opening "pop-up" at the end (intecettamento then manage the download) I think I can make and are making good progress. Maybe if I finish everything I can post it here, maybe you can help someone ;-) .
    Thanks

Leave a comment

XHTML TAG PERMIT: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERTION CODE:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL