相关疑难解决方法(0)

打开bootstrap模式弹出窗口时启用后台

我在我的项目中使用了bootstrap的模式弹出窗口,并希望得到以下内容:

  1. 当打开模态弹出窗口并单击后台弹出窗口时,不应该关闭.
  2. 当打开模态弹出背景时不应该模糊.意思是打开模态弹出背景不应该影响任何方式.
  3. 打开模态弹出窗口后,用户也可以在后台弹出窗口不应该关闭的情况下工作.

css twitter-bootstrap bootstrap-modal

7
推荐指数
1
解决办法
2万
查看次数

如何使用 Bootstrap 重置弹出模式的位置?

我正在寻找解决我的问题的方法,我看到了很多不同的方法来做到这一点,但没有一个对我有用。我将把我的代码粘贴到这里,看看你是否能以某种方式帮助我。我有一个可拖动的弹出窗口来显示注释。主屏幕上有一个项目列表,每次用户单击“查看”链接时,都会打开弹出窗口,其中包含该特定项目的注释。一切正常。弹出窗口将打开并显示正确的信息,我可以在屏幕上移动弹出窗口。那么我遇到的唯一问题是:一旦我关闭弹出窗口并打开一个新的弹出窗口,它不会将弹出窗口重置到原始位置,而是准确地打开我离开另一个弹出窗口的位置。当用户关闭弹出窗口时,我需要重置弹出窗口的位置。

这是我的js:

require(['jquery'
    , 'bootstrap'
    , 'datepicker'
    , 'typeahead'
    , 'combobox'
    , 'tagsinput'
], function($){

    // DOM ready
    $(function(){
        $('.modal-dialog').draggable();

        $('#noteModal').on('show.bs.modal', function(e) {

            //get data-id attribute of the clicked element
            var note = $(e.relatedTarget).data('note');
            //populate the textbox
            $(e.currentTarget).find('span[name="note"]').text(note);
        });



    });
});
Run Code Online (Sandbox Code Playgroud)

这是我的 html 页面上的模式:

<!-- Modal to display the Note popup -->
<div class="modal" id="noteModal" tabindex="-1" role="dialog" aria-labelledby="noteModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="noteModalLabel">Note</h4>
            </div>
            <div class="modal-body">
                <span name="note" id="note"></span> …
Run Code Online (Sandbox Code Playgroud)

javascript bootstrap-modal

4
推荐指数
1
解决办法
3237
查看次数