打开Bootstrap模态后无法单击任何内容 [英] Can't click anything after i open my Bootstrap modal
问题描述
很抱歉,我正在使用MVC ASP.NET进行工作,并且试图在导航栏中添加引导程序模版,运行代码,我可以看到可以触摸的按钮,但之后它打开,屏幕无法点击,我必须按f5键再次单击任何地方,这是我第一次使用引导程序中的模态,如果我必须编写一些JavaScript代码,则在Google周围搜索,但是到处都说你只需要jquery,引导程序.js和.css,仅此而已.如果我想念什么,请告诉我.谢谢,这是我的代码.
sorry for the basic question, I'm working on MVC ASP.NET and I'm trying to add a bootstrap modal in my navbar, I run the code, i can see the button i can touch on it, but after it open, the screen is unclickable i have to f5 to click anywhere again, it's the first time i use modals from bootstrap, and search all around google if I have to write some JavaScript code, but everywhere says that you just need jquery , bootstrap.js and .css and nothing else. If I'm missing something just let me know. Thanks, Here is my code.
PD:我已经在引导程序中运行过轮播
PD: I have a carousel already working from bootstrap
@if (Session["usuario"] == null)
{
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Ingresar
</button>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Iniciar Sesión</h4>
</div>
<div class="modal-body">
<form method="post" action="@Url.Action("DoLogin","Usuario")">
<span class="alert-danger">@ViewBag.NoUser</span>
<label for="NombreDeUsuario" class="sr-only">Nombre de Usuario</label>
<input type="text" id="NombreDeUsuario" name="NombreDeUsuario" class="form-control" placeholder="Ingresa tu Usuario" required="" autofocus="" />
<br />
<label for="Contrasena" class="sr-only">Contraseña</label>
<input type="password" id="Contrasena" name="Contrasena" class="form-control" placeholder="Ingresa tu Contraseña" required="" />
<br />
<button class="btn btn-lg btn-primary btn-block" type="submit">Ingresar</button>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
}
这是问题的屏幕截图
Here is a screenshot of the problem
推荐答案
.modal-backdrop {
z-index: -1;
}
这篇关于打开Bootstrap模态后无法单击任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!