簡體   English   中英

Bootstrap:為什么我的Modal是透明的?

[英]Bootstrap: why is my Modal transparent?

我想使用Bootstrap庫中的Modal。

當我單擊按鈕時,將顯示“模態”,但它是透明的。

我不知道為什么會這樣。

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

那應該解決它。

干杯!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM