无法从bootstrap模态中的链接打开模态

时间:2018-02-07 11:53:04

标签: jquery twitter-bootstrap

非常奇怪。

如果我从下拉列表中取出assign链接,并将其放在我的页面上的任何位置 - 它可以正常运行并显示模态。但是当它在下拉列表中时,我点击它并没有任何反应......

<div class="btn-group m-b-10 btn-block">
    <button type="button" class="btn btn-warning  btn-block"><i class="far fa-check-square"></i> Tools</button>
    <button type="button" class="btn btn-warning dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        <div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; transform: translate3d(82px, 36px, 0px); top: 0px; left: 0px; will-change: transform;">
            <a class="dropdown-item txt-danger" id="testbtn" style="cursor:pointer"><i class="far fa-trash-alt"></i> Delete</a>
            <div class="dropdown-divider"></div>
            <a class="dropdown-item text-danger" data-toggle="modal" data-target="#myModal" href="#"><i class="fas fa-sitemap"></i> Assign </a>
            <div class="dropdown-divider"></div>
        </div>
</div>

1 个答案:

答案 0 :(得分:1)

**Try this**
<br>
<div class="btn-group m-b-10 btn-block">
    <button type="button" class="btn btn-warning  btn-block"><i class="far fa-check-square"></i> Tools</button>
    <button type="button" class="btn btn-warning dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
        <div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; transform: translate3d(82px, 36px, 0px); top: 0px; left: 0px; will-change: transform;">
            <a class="dropdown-item txt-danger" id="testbtn" style="cursor:pointer"><i class="far fa-trash-alt"></i> Delete</a>
            <div class="dropdown-divider"></div>
            <a class="dropdown-item text-danger" data-toggle="modal" data-target="#myModal" href="#"><i class="fas fa-sitemap"></i> Assign </a>
            <div class="dropdown-divider"></div>
        </div>
</div>