The first time you call .dialog(options) is an initialization. If you close
the dialog after that (either by clicking on the 'X' or calling
$(el).dialog('close') it is still initialized. If you want to re-open it,
call $(el).dialog('open');

The only time you would call .dialog(options) again is if you were calling
it on a different element (creating a new dialog) or if you had called
.dialog('destroy') on the first element.

One final note, unless you've set autoOpen to false in the options (the
default is true), there's no need to call $(el).dialog('open') right after
you call .dialog(options).

If you have any further questions about UI Dialog (or any jQuery UI
plugins), for the benefit of those on it, please post to the jQuery UI list:

http://groups.google.com/group/jquery-ui/

Thanks.

- Richard

Richard D. Worth
http://whoisi.com/p/577

On Sun, Jul 13, 2008 at 4:53 PM, Pitrsonek <[EMAIL PROTECTED]> wrote:

>
>
> Hi, i have this function:
>
> function showSendMessage(id){
> $('#sendMessage').dialog({modal: true,overlay:{opacity:
> 0.5,background: "black"},title: 'Kontaktovat uživatele'});
> //$('#sendMessage').dialog('open');
>        $('#sendMessage').css({ display:"block"});
>        $('#ClientsRecipientId').attr({ value: id});
>    }
>
> this function is use when i click on some buttons (onclick). If I
> click on buttone once dialog will be show i close dialog, after second
> click on button will be not show.
>
> So i try correct function:
>
> function showSendMessage(id){
> $('#sendMessage').dialog({modal: true,overlay:{opacity:
> 0.5,background: "black"},title: 'Kontaktovat uživatele'});
> $('#sendMessage').dialog('open');
>        $('#sendMessage').css({ display:"block"});
>        $('#ClientsRecipientId').attr({ value: id});
>    }
>
> Its quite ok, i can click on buttone how often i want and dialog will
> show but when i click on cross icon (close dialog) overlay forever
> show and i cant click anywhere.
>
> THX for your advice. Sorry my english isn very good.
>

Reply via email to