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 one option is to remove 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');}
});
  • joseph

    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 alerts to wait while it is downloading the pdf. How can I do??
    Thank you for your help.
    joseph

  • http://www.undolog.com 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, might choose to open it, in fact sostituiendo your web page with the content pdf.
    Aside from that, you would not, however, no way of knowing 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 show the download avanzamente and the likelihood of your message would be redundant.
    Let me know if I understand the question and if you have other questions.

  • joseph

    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've 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 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 of 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 shut it down when it appears in 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

  • http://www.undolog.com Giovan Battista Fazioli

    @ Joseph: ok, if you want we can divide 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 (size 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. Then setting it with an alpha adequate creates the darkening effect you want.
    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 ...

  • joseph

    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 (reload) the page is closed finestra.O me suggest another. The important thing to happen automatically without tap again.
    Regarding 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 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

  • luciano

    prejudice to take this opportunity to ask:

    in my jsp page I have included jquery to display 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
    $ ("# Mio_dialog.") Dialog ({
    resizable: false,
    width: 385,
    dialogClass: 'ui-dialog-cmd',
    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 use the escape key to closing it.

    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 from them?

    thanks