Bootstrap Modal在关闭后冻结页面

问题描述:

不知道为什么,但是我的Bootstrap Modal在我点击关闭按钮后冻结了我的屏幕。引导版本是3.3.6Bootstrap Modal在关闭后冻结页面

模态代码:

<!-- Modal --> 
<div id="myModal" class="modal fade" role="dialog" !important> 
    <div class="modal-dialog modal-lg"> 

     <!-- Modal content--> 
     <div class="modal-content"> 
      <div class="modal-header"> 
       <button type="button" class="close" data-dismiss="modal">&times;</button> 
       <h4 class="modal-title">Edit Message</h4> 
      </div> 
      <div class="modal-body"> 
       <textarea class="form-control" rows="10" ng-model="msg.message" required autofocus style="max-width: 100%;">{{msg.message}}</textarea> 
      </div> 
      <div class="modal-footer"> 
       <button type="submit" class="btn btn-default" ng-click="controller.edit(msg)">Edit And Close</button> 
      </div> 
     </div> 

    </div> 
</div> 

按钮点击呼叫模式:被称为上接近

<button class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal"><span class="glyphicon glyphicon-pencil"></span></button> 

方法:

public edit(message) { 
    console.log(message); 
    this.$http.put(`api/causemessage`, message).then((res) => { 
     this.$state.reload(); 
    }); 
} 

如果有人能帮助诊断这个问题,那将非常感谢!

+0

小提琴将很高兴有 –

+0

你应该使用角引导而不是引导与jQuery –

+0

@SiddharthPandey我的整个项目是数百个文件长。除了核心引导文件之外,我给你所有与模态本身相关的东西。 我也可以使用一堆不同的模态和方法,没有冒犯性,我只是在寻找一种解决方案来解决我目前的方法。 –

尝试使用方法下面的脚本,你在千钧一发..

$( '#myModal')模态( '隐藏')。

+0

工作过,谢谢! 对于那些无法让jQuery识别.modal的人。 你可以做到这一点。 ( $('#myModal'))。modal('hide'); –

+0

:-) ..ya.thankyou !! :-) – Ashwin