bootstrap 3模式窗口不起作用 [英] bootstrap 3 modal window not working

查看:83
本文介绍了bootstrap 3模式窗口不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Bootstrap 3(完整版),并且在代码中使用了引导程序模版:

I'm using Bootstrap 3 (full version) and I use bootstrap modal in my code:

<a data-toggle="modal" data-target="deleteMessage" class="btn btn-danger btn-sm"><span class="glyphicon glyphicon-remove"></span> Удалить</a>

<!-- Modal -->
<div id="deleteMessage" class="modal fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Modal title</h4>
            </div>
            <div class="modal-body">
                ...
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary">Save changes</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

此代码是我从官方文档中复制的,但无法正常工作,不会显示模式窗口.

This code I copied from official docs, but it's not working, modal window does not display.

出什么问题了?

非常感谢.

推荐答案

尝试将锚代码更改为:

<a data-toggle="modal" data-target="#deleteMessage" class="btn btn-danger btn-sm"><span class="glyphicon glyphicon-remove"></span> Удалить</a>

该教程中似乎有一个错字,在data-target属性中应该有附加的#".

It looks like there is a typo in the tutorial, there should be additional "#" in the data-target attribute.

这篇关于bootstrap 3模式窗口不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆