2015-09-08 83 views

回答

1

背景与下面的类射击:.modal-backdrop有附加.in类的不透明度。

默认值(编辑根据需要):

.modal-backdrop { 
    position: fixed; 
    top: 0; 
    right: 0; 
    bottom: 0; 
    left: 0; 
    z-index: 1040; 
    background-color: #000; 
} 
.modal-backdrop.in { 
    filter: alpha(opacity=50); 
    opacity: .5; 
} 
+0

适用于所有模式..如何使用特定的模式.. – Manigandaprabhu

+0

@Manigandaprabhu: '#模式-ID .modal-背景{ ... }' –

+0

在给定的例子,改变'透明度。 5;'不透明度:.0;' –

3

我可以使用下面的代码片段通过隐藏模型叠加刚刚重新隐藏模式在触发事件shown.bs.modal

<script type="text/javascript"> 
    $('#modal-id').on('shown.bs.modal', function() { 
     $(".modal-backdrop.in").hide(); 
    }) 
</script> 
8

data-backdrop="false"选项作为属性添加到打开模式的按钮。

<!-- Button trigger modal --> 
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" data-backdrop="false"> 
    Launch demo modal 
</button> 

modal options

0

你也可以在你的CSS和引导外单击功能仍然有效设置

.modal-backdrop { 
    background-color: transparent; 
}