bootstrap-modal - 如何在bootstrap模态框中使用bootstrap确认?

标签 bootstrap-modal confirmation bootstrap-popover

我想使用引导确认 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>

最佳答案

我刚刚为您制作了一个演示。它可能对你有帮助。 请检查以下 fiddle - http://bit.ly/1aD42Y8

关于bootstrap-modal - 如何在bootstrap模态框中使用bootstrap确认?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29696930/

相关文章:

html - 在 Bootstrap 模式中将文本区域宽度设置为 100%

javascript - Bootstrap 4 Popover - 人员输入字段(不显示弹出窗口)

javascript - JQuery 数据表中的 Bootstrap Popover 在搜索后不起作用

javascript - 如何使用 content 和 setcontent 在 bootstrap popover 中设置变量值?

angular - 无法读取未定义的属性 'backdrop'

css - 如何使 bootbox.prompt 工作?

javascript - 日期选择器在另一个路由页面或在 vue js 中返回时不起作用?

email - 使用 MailChimp API V3.0 向取消订阅的成员重新发送选择加入电子邮件

bash - 在 Bash 中,如何将 "Are you sure [Y/n]"添加到任何命令或别名?