【问题标题】:Bootstrap Modal in image not working in iOS图像中的引导模式在 iOS 中不起作用
【发布时间】:2017-07-05 14:13:39
【问题描述】:

我遇到了引导模式无法在 Safari 和 iOS 上正常运行的问题。我在 Stack Overflow 中阅读过类似的问题,但找不到在图像中使用 Modals 时出现问题的问题。有人可以提供一些见解和帮助吗?

<img alt="therapist" class="img-circle" data-target="#linda" data-toggle="modal" src="img/team/linda.png"> // modal opens when image is clicked
<h3 class="team--name" data-target="#linda" data-toggle="modal">Linda</h3>
<!-- Modal -->
<div aria-labelledby="myModalLabel" class="modal fade" id="linda" role="dialog" tabindex="-1">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span></button>
                <h2 class="modal-title team--name" id="myModalLabel">Linda</h2>
                <h4 class="team--name">CAMTC</h4>
            </div>
            <div class="modal-body">
                <p>Linda brings compassion, positive energy and balance into her clients' lives</p>
            </div>
            <div class="modal-footer">
                <button class="btn btn-success" data-dismiss="modal" type="button">Close</button>
            </div>
        </div>
    </div>
</div>

我尝试在图像中实现下面的类,但无济于事。

.clickable {
    cursor: pointer;
}

【问题讨论】:

    标签: ios css twitter-bootstrap safari


    【解决方案1】:

    情况已解决。

    我添加了以下脚本以将模态附加到正文。

    $(document).ready(function () {
        $(".modal").appendTo("body");
    });
    

    【讨论】:

    • 这个工作是因为模态需要在主体之外吗?
    猜你喜欢
    • 2021-04-05
    • 2014-01-17
    • 2016-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多