【问题标题】:Bootstrap modal window not opening from inside bootstrap popover引导模式窗口未从引导弹出窗口内部打开
【发布时间】:2020-05-26 21:15:28
【问题描述】:

当您单击“MAGIC”时,会显示一个引导弹出窗口,您会在其中看到设置图标。如果单击该图标,则应打开一个模式窗口,例如单击蓝色按钮“启动演示模式”。我该如何解决?有什么问题?

这是我的代码:https://jsfiddle.net/vhsqf65z/

<span data-html='true' data-toggle='popover'
    title='<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal"><i class="glyphicon glyphicon-cog"></i></button>'
    data-content='<b>content</b>'> MAGIC </span>

<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
    <div class="modal-content">
        <div class="modal-header">
            <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
        <div class="modal-body">
            ...
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data- 
dismiss="modal">Close</button>
            <button type="button" class="btn btn-primary">Save changes</button>
        </div>
    </div>
</div>

谢谢

编辑: 添加了显示弹出框和设置按钮的图像。 enter image description here

【问题讨论】:

  • 我在引导弹出窗口中看不到任何设置图标(我会向您发送捕获但我不能在评论中显示)
  • @Dalibor 我在问题中添加了一张图片。

标签: javascript jquery twitter-bootstrap bootstrap-modal bootstrap-popover


【解决方案1】:

我修改了你的代码,删除了处理inserted.bs.popover事件:

https://jsfiddle.net/05nzfcak/

我测试过它有效(如果我理解正确的话)

【讨论】:

  • 您好 Dalibor,感谢您的帮助。现在可以了。好的,这就是弹出框点击功能。无论如何我都需要重写这个函数,因为它并不总是按预期工作。非常感谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-02-16
  • 1970-01-01
  • 1970-01-01
  • 2013-05-01
  • 1970-01-01
  • 2020-05-18
  • 2018-05-08
相关资源
最近更新 更多