0

I have try use dialog message. My question, how to hidden it/ its not see anything? My destination is to create media query when desktop its hide and other media showing so I need code for hide in css/html file. My code: style="display:none;" but fail.

My code on fiddle: here

Thanks

Gede Budi
  • 3
  • 1
  • 3

4 Answers4

1

you can use close method as the api mention

$(#dialog-message ).dialog( "close" );

the above will work after a dialog is showed. But if don't want to show the dialog at the time the page is loaded just use the autoOpen option

$(function() {
$( "#dialog-message" ).dialog({
modal: true,
    autoOpen: false,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
}
}
});
});
Instance Noodle
  • 227
  • 1
  • 10
  • but my media query didn't work. I want to hide only on desktop so I need to hide use css or html file – Gede Budi Jun 26 '13 at 06:53
  • My destination is to create media query when desktop its hide and other media showing so I need code for hide in css/html file. If you edit on javascript, my media query will not working. Thanks – Gede Budi Jun 26 '13 at 06:57
  • i think it should be done by javascript manually , please refer [this one](http://stackoverflow.com/q/7995752/1599694) to know how to do it – Instance Noodle Jun 26 '13 at 07:08
  • could you please to modify your fiddle because css media query its different with js media query. Thank you – Gede Budi Jun 26 '13 at 07:15
  • why didn't work on my desktop. can use media query(max width, min width) – Gede Budi Jun 26 '13 at 07:25
0

You have to do

$( "#dialog-message" ).dialog( "close" );

WORKING FIDDLE

Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
0

something like this?

$(function() {
$( "#dialog-message" ).dialog({
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
}
}
});
$('.ui-dialog').css('display','none');
});

if i've understand you necessity ...

Lucabro
  • 525
  • 3
  • 9
  • 30
0

In the bootstrap 4,

// hiding the model,       
$('#myModal').modal('hide');
Nick
  • 138,499
  • 22
  • 57
  • 95