[英]How to prevent the backdrop of bootstrap modal dialog from covering the whole screen?
[英]jQuery Bootstrap dialog $backdrop is undefined
我在應用程序中使用Bootstrap對話框鏈接 。 我已經在html的頭部分中包含了依賴項
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script src="js/bootstrap-paginator.js" type="text/javascript"></script>
<script src="js/bootstrap-dialog.js" type="text/javascript"></script>
我遇到了錯誤
Uncaught TypeError: Cannot read property 'css' of undefined
在行中
$backdrop.css('z-index', zIndexBackdrop + (dialogCount - 1) * 20);
在bootstrap-dialog.js中 ,其中$ backdrop
為null
。
這是我寫的代碼
callback.prototype.success = function(XMLHttpRequest,textStatus){
showDialog("Title",
"Message",
BootstrapDialog.TYPE_SUCCESS);
}
function showDialog(title,msg,type){
BootstrapDialog.show({
title: title,
message: msg,
type : type,
buttons: [{
label: 'OK',
action: function(dialog) {
dialog.close();
}
}]
});
}
感謝您的幫助。
我解決了這個問題。 問題出在Bootstrap js版本,它在主要版本2中。升級到Bootstrap 3
版本修復了它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.