2016-05-23 36 views
0

我有意见的图片库。该图像以模态打开。 当我尝试删除图像评论我打开新的确认模式。问题是因为确认模态变为双向模态。检查截图Bootstrap confirm modal bihaind主模态

数字1是主模态。点击x里面的评论我打开数字2模态,但他是bihaind。

enter image description here

我试图把与z-index先删除模式,但无法工作

#confirm-delete { 
    z-index: 1000 !important; 
} 
+1

你能为此创建一个小提琴吗? –

+1

不要手动设置模态的z-index!我个人使用这个:http://jschr.github.io/bootstrap-modal/它使得Bootstrap模式在小配置下变得更好。它是可堆叠的,它可能只是解决你的问题。 –

+0

是可堆叠的slove我的问题。谢谢@DanielCheung – Ivan

回答

2

决不手动设置模式的z-index的!

发生此问题是因为Bootstrap默认情况下未对模块的z-index进行排序。

我个人使用这个:http://jschr.github.io/bootstrap-modal它使Bootstrap模式在小配置下变得更好。它是可堆叠的,它可能是解决问题的最好方法。

我假设你正在使用Bootstrap 3,下面的代码将会很好。

<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.css" rel="stylesheet"/> 
<link href="http://jschr.github.io/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" /> 
<link href="http://jschr.github.io/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" /> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> 
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.js"></script> 

按此顺序加载CSS资源,插件会自动管理模态的z-index。