我在引导程序中使用此模式:

<div class="modal" id="contact-update-view">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title">Update contact</h4>
                        </div>
                        <form class="form-horizontal">
                            <div class="modal-body">
                                <div class="form-group">
                                    <label for="contact-create-name" class="col-sm-4  control-label">Name</label>
                                    <div class="col-sm-8">
                                        <div class="input-group">
                                            <div class="input-group-addon">
                                                <span class="glyphicon glyphicon-user"></span>
                                            </div>
                                            <input type="text" class="form-control" id="contact-create-name" name="contact-create-name" data-minlength="2" placeholder="Contact's Name" data-error="Name should atleast be 2 characters long" required />
                                            <div class="help-block with-errors"></div>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="contact-create-phone" class="col-sm-4  control-label">Phone</label>
                                    <div class="col-sm-8">
                                        <div class="input-group">
                                            <div class="input-group-addon">
                                                <span class="glyphicon glyphicon-phone"></span>
                                            </div>
                                            <input type="tel" class="form-control" id="contact-create-phone" name="contact-create-phone" placeholder="Phone Number" pattern="^(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$"  data-error="Enter a valid phone number" required/>
                                            <div class="help-block with-errors"></div>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="contact-create-email" class="col-sm-4  control-label">Email</label>
                                    <div class="col-sm-8">
                                        <div class="input-group">
                                            <div class="input-group-addon">
                                                <span class="glyphicon glyphicon-envelope"></span>
                                            </div>
                                            <input type="email" class="form-control" id="contact-create-email" name="contact-create-email" placeholder="Email" required data-error="The email is invalid"/>
                                            <div class="help-block with-errors"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <div class="form-group">
                                    <div class="col-sm-offset-4 col-sm-8">
                                      <button type="submit" class="btn btn-success" data-toggle="tooltip" title="Yep! Two exclamations and a question mark,arent you excited?">Add contact!</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>


我使用bootcards-desktop.css from here,我发现背景显示在modal上方。当我单击模式时,它会立即关闭。

我用这个打开模态:

 <button type="button" class="btn btn-default btn-edit" data-toggle="modal" data-target="#contact-update-view">
    <span class="glyphicon glyphicon-pencil"></span>
 </button>


我在CSS中看到了这种差异:

.modal
        z-index:1050;
        position:fixed;

   .modal-backdrop:
       position:fixed;
       z-index:1040;


当我单击模态时,它消失了(好像模态顶部有一个背景),我如何才能使模态与引导卡一起正常使用?

最佳答案

这不是Bootstrap 3.3.1问题,也不是Bootcards问题。问题出在安装程序中:bootcards-desktop.min.css文件(以及Android和iOS版本)是Bootstrap(当前为v3.2.0)和Bootcards CSS文件的串联版本。提供此功能是为了减少一个HTTP请求。在Bootcards下载的dist文件夹中,您还将找到没有内置Bootstrap的CSS文件版本:它们的后缀为-lite(并且后缀要小得多...)。

在您的Plunkr中,如果我将Bootstrap版本更改为v3.3.1并将bootcards-desktop.min.css更改为bootcards-desktop-lite.min.css,则它们将再次起作用。

我将很快发布另一个版本的Bootcard,它将扩展Bootstrap v3.3.1。

09-29 20:31