操作對話標題
將 CSS 包含在你的程式碼中
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.7/css/bootstrap-dialog.min.css"/>
你的模型的 HTML 程式碼可以輕鬆顯示
Click Button next to see bootstrap popup with simple message and Title and Buttons that manipulates the title.
<button class="btn btn-primary" type="button" onclick="showModalNow()">Click Me</button>
在程式碼中包含以下指令碼,以便輕鬆地使用 bootstrap-model
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.7/js/bootstrap-dialog.min.js" type="text/javascript" />
<script>
function showModalNow(){
BootstrapDialog.show({
title: 'Default Title',
message: 'First time showing Title.',
buttons: [{
label: 'change to Title 1',
action: function(dialog) {
dialog.setTitle('Title-1');
}
}, {
label: 'change to Title 2',
action: function(dialog) {
dialog.setTitle('Title 2');
}
}]
});
}
</script>