twitter-bootstrap Bootstrap 模式未显示。只有背景变成黑色

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19178224/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 18:43:51  来源:igfitidea点击:

Bootstrap modal not showing. Only background becomes black

phpjquerytwitter-bootstrapmodal-dialogbootstrap-modal

提问by Sankalp Mishra

I am using bootstrap modal. The triggrer is like this:

我正在使用引导模式。触发器是这样的:

<a id="add-feed-button"  role="button" data-toggle="modal" href="#add-feed-form" class="btn pull-right btn-success"   style="margin-left:5px; margin-top:-4px;">Add new</a>

and my modal:

和我的模态:

 <div id="add-feed-form" class="form-feed modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
this is modal.
</div> 

Problem is that only the backdrop becomes black but no modal appears.

问题是只有背景变成黑色,但没有出现模态。

I have included bootstrap.js and also bootstrap.min.css. I have used modals quite a times but this is a strange problem.

我已经包含了 bootstrap.js 和 bootstrap.min.css。我已经多次使用模态,但这是一个奇怪的问题。

回答by Shivam Chopra

Remove .hideclass from div#add-feed-formand then it will work fine.

.hide从中删除类div#add-feed-form,然后它将正常工作。

Demo

演示