非常奇怪的行为bootstrap模态背景

时间:2017-03-12 19:44:50

标签: jquery twitter-bootstrap

我有一个像这样的简单模态:

<div id="editbox-settings" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="editbox-settings" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <div class="aligncenter textbold">
                    <h3>Settings</h3>
                </div>
            </div>
            <div class="modal-body">
                <ul class="nav nav-pills nav-justified tabs-holder" style="white-space:nowrap">
                    <li><a id="tab-1" class="btn btn-default ctrl-tabs" href="#fakelink">Image</a></li>
                    <li><a id="tab-2" class="btn btn-default ctrl-tabs" href="#fakelink">Link</a></li>
                </ul>
                <div class="tab-contents mt30">
                    <div id="tab-1" class="clearfix content-box" style="display: none;">
                        //content tab 1
                    </div>
                    <div id="tab-2" class="clearfix content-box" style="display: none;">
                        //content tab 2
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-block btn-default close-modal">
            </div>
        </div>
    </div>
</div>

当我打开这个模态时会发生奇怪的事情,背景区域将被添加到模态中,如下所示:

 <div id="editbox-settings" class="modal fade in" tabindex="-1" role="dialog" aria-labelledby="editbox-settings" aria-hidden="false" style="display: block; padding-right: 0px;">
//backdrop added here       
<div class="modal-backdrop fade in" ></div>
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <div class="aligncenter textbold">
                        <h3>Settings</h3>
                    </div>
                </div>
                <div class="modal-body">
                    <ul class="nav nav-pills nav-justified tabs-holder" style="white-space:nowrap">
                        <li><a id="tab-1" class="btn btn-default ctrl-tabs" href="#fakelink">Image</a></li>
                        <li><a id="tab-2" class="btn btn-default ctrl-tabs" href="#fakelink">Link</a></li>
                    </ul>
                    <div class="tab-contents mt30">
                        <div id="tab-1" class="clearfix content-box" style="display: none;">
                            //content tab 1
                        </div>
                        <div id="tab-2" class="clearfix content-box" style="display: none;">
                            //content tab 2
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-block btn-default close-modal">
                </div>
            </div>
        </div>
    </div>

我必须使这个模态可拖动,但如果我这样做,它当然会拖动背景。

有人知道为什么在模态对话框中添加了背景?

谢谢。

0 个答案:

没有答案