How to hide the close button of a jQuery UI dialog

While waiting for the official release of jQuery UI 1.7 (oh yeah, the jQuery development team has decided that it will release the version as 1.7, due to confusion), where perhaps will be one option to delete the close button of a dialogue, here's how quickly resolve the problem with the current 1.6rc6:

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

6 comments to: " "

  1. March 16, 2009 giuseppe:

    Salve. I would like to ask for help.
    I just started learning jquery.
    I would like to make a small function, like the one used in flash galleries, to open a dialog window and darken the background. My goal is this:
    I have a button (image) that allows you to download a pdf. I would like to open a dialog that obscures the rest and prompts you to wait while it is downloading the pdf. How can I do??
    Thank you for your help.
    giuseppe

  2. March 16, 2009 Giovan Battista Fazioli :

    @ Joseph: in this case I think it is possible to do exactly what you ask for. First of all, you're not "uploading" a pdf, as would be the case of an image, but you do download users. Some, in fact, you can choose to save it to disk others, however, may choose to open it, in fact sostituiendo your web page with the content pdf.
    Aside from that, you would not have anyway so you know when the pdf has been "downloaded" completely! So any open dialog would remain for eternity.
    Also, when downloading a file (as in your case), we think the browser to display the avanzamente of the download and the likelihood of your message would be redundant.
    Let me know if I understand the question and if you have other questions.

  3. March 16, 2009 giuseppe:

    Hello and thanks for the bargain super fast response.
    In fact you're right, and maybe I was not clear I;-p.
    So, the fact is this:
    I have already made throughout the application, in java2ee, jsp, and allows you to download pdf pressing the pulzante. In fact automatically allows the user to choose whether to open or save the PDF externally.
    So far, so good. Now I have the need (waiting time variables and some users ricliccano several times in spite of the progress of the download the browser), constringere of the user to wait for 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 to save). Hope this helps and if it is possible to use jquery (since I'm studying now), or do any other way. With the bargain
    Joseph

  4. March 16, 2009 Giovan Battista Fazioli :

    @ Joseph: ok, if you want we can break the problem into two: open a dialog or darken the background, and intercept downloading the pdf. For the first problem the solution is quite simple and 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 place a div (with dimensions of 100%) immediately after the tag body , initially set to invisible display:none and absolute position position:absolute with the background to any color you want and make it visible at the appropriate time. Setting it with an alpha then you create the proper dimming effect desired.
    As for the problem dell'intercettare opening the box of the browser I think, that for security reasons, it is not really possible to do so. However, it is interesting topic and try to have a look around if there is any way to tell if the dialogue sdi downloading "is" to be opened ...

  5. March 19, 2009 giuseppe:

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

  6. December 5, 2012 luciano:

    prejudice to take this opportunity to ask:

    in my jsp page I have included jquery for displaying a dialog.

    the vision of the dialog takes place at the click of a button that calls a js function inside which there is:

    1
    2
    3
    4
    5
    6
    7
    ) . dialog ( { $ ("# Mio_dialog.") Dialog ({
    , resizable: false,
    , width: 385,
    , dialogClass: 'ui-dialog-cmd',
    $ ( obj ) . position ( ) . left - 375 , $ ( obj ) . position ( ) . top - $ ( document ) . scrollTop ( ) + 135 ] , position: [$ (obj). position (). left - 375, $ (obj). position (). top - $ (document). scrollTop () + 135],

    });

    the dialog opens correctly but I can not shut it down (or rather hide) when I click outside of his area of ​​expertise.

    I do not have to use it to escape it close button.

    Is there a way to make sure that as soon as you click on any part of the screen that is not the dialog is hidden these?

    thanks

Leave a comment

TAG XHTML PERMITS: CODE ENTRY:
 <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