我有一個場景,我上傳文件使用IFRAME
。我想要的是成功上傳文件後,我想關閉modal
彈出。但它不適用於我的情況。我試着像下面文件上傳提醒後關閉模式彈出
function CloseWindowFunction() {
alert('PDF uploaded successfully');
$('.modal-dialog').modal('toggle');
}
也請參閱HTML爲同一
<div class="modal fade" id="dvFileUpload" tabindex="-1" role="dialog" aria-labelledby="dvFileUploadTitle" aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">File Upload</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" data-keyboard="false">
<iframe id="ifrmFileUpload" clientidmode="Static" runat="server" style="overflow: hidden; border: none" frameborder="0" scrolling="no"></iframe>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
所以,我應該怎麼關閉模式彈出,因爲我的代碼是不是有toggle
財產的工作。
可能的複製關閉(初始啓動後)](https://stackoverflow.com/questions/10495421/how-to-get-twitter-bootstrap-modal-to-close-after-initial-launch) –