javascript - Bootstrap : why is my Modal transparent?

标签 javascript jquery css twitter-bootstrap

我想使用 Bootstrap 库中的模式。

当我点击按钮时,显示模态,但它是透明的。

我不明白这是为什么。

JSFiddle 链接: http://jsfiddle.net/0cqkdjey/

这是我的 HTML:

<div id="loginWindow" tabindex="-1" role="dialog" class="modal fade" aria-hidden="true">
    <div class="modal-dialog">
        <div class="model-content">
            <div class="modal-header">
                <button type="button" data-dismiss="modal" class="close">
                    <span aria-hidden="true">×</span>
                    <span class="sr-only">Close</span>
                </button>
                <h4 id="loginLabel" class="modal-title">Log in</h4>
            </div>
            <div class="modal-body">
                <input id="email" type="text">
            </div>
            <div class="modal-footer">
                <p>blablabla</p>
            </div>
        </div>
    </div>
</div>

这是我的 JavaScript:

$(document).ready( function() {

    // set focus when modal is opened
    $('#loginWindow').on('shown.bs.modal', function () {
        $('#email').focus();
    });

    // everytime the button is pushed, open the modal, and trigger the shown.bs.modal event
    $('#loginButton').click(function () {
        $('#loginWindow').modal({
            show: true
        });
    });

});

最佳答案

找到了:

<div class="model-content">

应该是:

<div class="modal-content"> // Notice the a

这应该可以解决问题。

干杯!

关于javascript - Bootstrap : why is my Modal transparent?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27364420/

相关文章:

javascript - 如何使用 JavaScript 解码 JPEG2000 位数组图像

javascript - 有没有更好的方法在 JavaScript 中执行可选函数参数?

javascript - 从段落标记中获取值

android - Owl Carousel 在移动 ios/android 上快速滚动时启用拖动

javascript - 如何防止回车键提交表单但仍允许回车键工作?

jquery - 将 CSS 应用于标题而不是 div

javascript - font-face作为div背景图片可能吗?

javascript - block "Confirm Form Resubmission"

javascript - 保存动态更改的 HTML

html - 发布响应式布局