Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dialog box hide() and show() -- Jquery?

Iam using 3 dialogs in my page for 3 diff purpose.

Iam creating dialog as

  $(".dialog").dialog({
        height: 238,
        width: 465,
        resizable: false,
        title: "Edit"
    });

After my action done on dialog iam closing dialog as

   $(".ui-dialog").hide();

When i hide this way dialog is not getting opening for 2nd time, So tried showing dialog starting of function like

  $(".ui-dialog").show();

My problem started here....

When i show dialog, Dialogs are getting opened multiple times, STill the first openined dialog is getting Overlapped wth the second dialog,

Is there any proper way to hide and Show dialog without overlapping or in clean way.

like image 360
þÍńķ Avatar asked Jun 28 '13 06:06

þÍńķ


People also ask

How to hide and show with jQuery?

Syntax: $(selector).hide(speed,callback); $(selector).show(speed,callback); The optional speed parameter specifies the speed of the hiding/showing, and can take the following values: "slow", "fast", or milliseconds.

How do you hide a dialog box?

Hiding the dialog window is as simple as setting the Visible property to False.

What will the jQuery code P hide (); do?

jQuery hide() Method The hide() method hides the selected elements. Tip: This is similar to the CSS property display:none. Note: Hidden elements will not be displayed at all (no longer affects the layout of the page).


1 Answers

You need to use the close(hide) and open(show) functions provided by the widget

$(".ui-dialog").dialog('close');
$(".ui-dialog").dialog('open');
like image 101
Arun P Johny Avatar answered Nov 13 '22 09:11

Arun P Johny