我试图使用模态。当我尝试单击模态时,它不会聚焦。我在顶部栏导航中调用模式是下拉列表(位于右上角)。我上传了一张照片,链接在代码下面。我正在使用bootstrap。我从here
获得了摘录我的代码:
<ul class="nav navbar-right top-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Admin User <b class="fa fa-angle-down">
</b></a>
<ul class="dropdown-menu">
<!--=====HERE IS WHERE I CALL THE MODAL=====-->
<li>
<a href="#" data-toggle="modal" data-target="#changeProfile"><i class="fa fa-fw fa-cog">
</i> Change Profile</a>
</li>
<li class="divider">
</li>
<li>
<a href="#"><i class="fa fa-fw fa-power-off">
</i> Logout</a>
</li>
</ul>
</li>
</ul>
<!-- Modal Add Brand -->
<div class="modal fade" id="changeProfile" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>
Change Profile
</h3>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="txtBusName" class="col-sm-2 control-label">Username</label>
<div class="col-sm-10">
<input type="text" id="txtUsername" class="form-control">
</div>
</div>
<div class="form-group">
<label for="txtBusDesc" class="col-sm-2 control-label">Password</label>
<div class="col-sm-10">
<input type="password" id="txtPassword" class="form-control">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</div>
<!-- Modal Add Brand -->
This is what it looks like. I can't click the modal at all.
谢谢!
答案 0 :(得分:0)
似乎您的模态框的z-index
值低于用于“阻止”网页内容的半透明暗div
。尝试增加模态框的z-index
值。
#changeProfile {
z-index: 9999;
}