Bootstrap Dialog 使用

光是bootstrap.min.css 和bootstrap.min.js 還不夠。由於Dialog 屬於插件。還須要引入bootstrap-dialog.js 和bootstrap-dialog.csscss

前者處處均可如下載。後者網上很差找。找了半天nakupanda.github.io/bootstrap3-dialog/ 和

https://github.com/nakupanda/bootstrap3-dialog html

這裏兩個地方能夠下載到例子。裏面包含了後面兩個文件。而後具體怎麼調用dialog就能夠看這個網站:jquery

http://nakupanda.github.io/bootstrap3-dialog/git

下面是一個簡單的例子: github

<!DOCTYPE html>

<html>

<head> 
<meta charset="utf-8" /> 
<title>Bootstrap 實例 - 標籤頁(Tab)插件</title> 
<link href="css/bootstrap.min.css" rel="stylesheet"> 
<link href="css/bootstrap-dialog.css" rel="stylesheet" /> 
<script src="js/jquery.min.js"></script> 
<script src="js/bootstrap.min.js"></script> 
<script src="js/bootstrap-dialog.js"></script>
</head>

<body> 
<a href="#" onclick="test()">測試按鈕</a>

</body>

<script> 
function test(){ 
    BootstrapDialog.confirm('確認刪除當前選中的記錄嗎?', 
         function(result){ 
             if(result) { 
                 BootstrapDialog.alert('I want 刪除!');
             } else { 
                 BootstrapDialog.alert('I want 不刪除!');
          } 
     }); 
} 
</script>
相關文章
相關標籤/搜索