【发布时间】:2015-04-17 10:38:45
【问题描述】:
我想在引导模式框中使用引导确认http://ethaizone.github.io/Bootstrap-Confirmation/#example。
但是,在调用模态框时,我通过 ajax post 方法调用模态框。在调用模态框时,我还包含了一些脚本,但它不起作用。
我在jquery中发送的脚本是http://www.jqueryscript.net/other/Clean-jQuery-Confirmation-Dialog-Plugin-with-Bootstrap-Popovers-Bootstrap-Confirmation.html
在模态框窗口中使用了这个脚本...
<script>
$(function(){
$('[data-toggle="confirmation"]').confirmation();
$('[data-toggle="confirmation"]').confirmation({
placement: 'top', // How to position the confirmation - top | bottom | left | right
trigger: 'click', // How confirmation is triggered - click | hover | focus | manual
target : '_self', // Default target value if `data-target` attribute isn't present.
href : '#', // Default href value if `data-href` attribute isn't present.
title: 'Are you sure?', // Default title value if `data-title` attribute isn't present
template: '<div class="popover">' +
'<div class="arrow"></div>' +
'<h3 class="popover-title"></h3>' +
'<div class="popover-content text-center">' +
'<div class="btn-group">' +
'<a class="btn btn-small" href="" target=""></a>' +
'<a class="btn btn-small" data-dismiss="confirmation"></a>' +
'</div>' +
'</div>' +
'</div>',
btnOkClass: 'btn-primary', // Default btnOkClass value if `data-btnOkClass` attribute isn't present.
btnCancelClass: '', // Default btnCancelClass value if `data-btnCancelClass` attribute isn't present.
btnOkLabel: '<i class="icon-ok-sign icon-white"></i> Yes', // Default btnOkLabel value if `data-btnOkLabel` attribute isn't present.
btnCancelLabel: '<i class="icon-remove-sign"></i> No', // Default btnCancelLabel value if `data-btnCancelLabel` attribute isn't present.
singleton: false, // Set true to allow only one confirmation to show at a time.
popout: false, // Set true to hide the confirmation when user clicks outside of it.
onConfirm: function(){}, // Set event when click at confirm button
onCancel: function(){}}) // Set event when click at cancel button
});
</script>
【问题讨论】:
-
请发布您的代码。没有它,我们无法为您提供太多帮助。
-
我还要问一个问题。是否正确包含了两个库(引导程序和引导程序确认)?
-
是引导确认和引导模式框包含在基本页面中。并且引导模态框工作正常。并且引导确认框在基本页面中正常工作,但在模式框内不起作用
-
我已经添加了一个答案。有帮助吗?
标签: bootstrap-modal confirmation bootstrap-popover