繁体   English   中英

如何禁用模式弹出框

[英]How to disable Modal pop up box

单击按钮时,将显示一个模式框。 该模式框包含两个按钮。 OKCancel按钮。 当我们单击“ OK按钮时,它将显示一个警报消息框,直到我正确为止。 但是我想在弹出警报消息时禁用模式框。 我尝试了很多方法,例如

  $("modalFileStruct").('disabled', true);
  $("#modalFileStruct").fadeOut("slow");
  $("#modalFileStruct").addClass("fade");
  $("#modalFileStruct").setFocusable(true)
  $("#modalFileStruct").css('style','background-color: #000; opacity:1; z-index:1000;');

  document.getElementById("modalFileStruct").removeAttribute("tabIndex");

  $('#fileStruct').blur();
  $("#modalFileStruct").css("position","relative","z-index","99");
  $('#modalFileStruct').fadeIn('slow');
  $('#modalFileStruct').fadeOut('slow'); 

但这不能满足我的需求。 有人可以帮我吗?

这是我的代码

   $("#modalFileStruct").modal();//This is pop up the modal box
   //This is the click function of OK button inside the modal box
   function fileInfoClicked(){
    alertMessage('Error',"Attribute name contains special characters: " + inps[i],
            'error');
            return;
 }

//警报消息框的代码

 function alertMessage(title, message, type) {
$.msgBox({
    title : title,
    content : message,
    type : type,
    modal : true
});
}
$("#modalFileStruct").modal();//This is pop up the modal box
   //This is the click function of OK button inside the modal box

   function fileInfoClicked(){
      $("#modalFileStruct").modal("toggle");
   }

我想您希望用户在单击页面时强制单击“确定”按钮,而不是关闭模式。 顺便问一下,您在使用哪个插件? 在Bootstrap中使用data-backdrop="static"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM