0

我尝试使用对话框消息。我的问题,如何隐藏它/它什么都看不到?我的目标是在桌面隐藏和其他媒体显示时创建媒体查询,因此我需要在 css/html 文件中隐藏的代码。我的代码:style="display:none;"但失败了。

我的小提琴代码:这里

谢谢

4

4 回答 4

1

您可以使用close 方法作为 api 提及

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

以上将在显示对话框后起作用。但是如果不想在页面加载时显示对话框,只需使用该autoOpen选项

$(function() {
$( "#dialog-message" ).dialog({
modal: true,
    autoOpen: false,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
}
}
});
});
于 2013-06-26T06:47:29.233 回答
0

你所要做的

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

工作小提琴

于 2013-06-26T06:42:09.420 回答
0

像这样的东西?

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

如果我理解你的必要性...

于 2013-06-26T06:49:12.293 回答
0

在引导程序 4 中,

// hiding the model,       
$('#myModal').modal('hide');
于 2019-01-09T05:41:34.837 回答