简体   繁体   English

Bootstrap模态与背景褪色

[英]Bootstrap modal with background fading in

I'm using bootstrap 1.4.0 and jquery 1.7.2. 我正在使用bootstrap 1.4.0和jquery 1.7.2。 I'm trying to create a modal window with fading background. 我正在尝试创建一个背景渐变的模态窗口。 The modal window should be loaded using javascript function. 应使用javascript函数加载模态窗口。

Here's the code I have: 这是我的代码:

<!-- Modal -->
<div id="error-dialog" class="modal hide fade">
  <div class="modal-body">
    <h1 class="exp-heading">Error</h1>
    <p class="exp-para pad-btm"> {$meta.message}</p>
    <!-- apps go here -->
    <div class="clear"></div>
    <!-- apps end here --> 
  </div>
  <div class="modal-footer"  align="center"><a href="#" data-controls-modal-close="error-dialog" ><img src="images/cancel_btn.png" alt="" border="0" align="middle" /></a> </div>
</div>

<script language="Javascript">  
$('#error-dialog').modal('show');                                                                   
</script>   

The modal is showing but the background is not fading in. The CSS file is the default one 1.4.0/bootstrap.css 模式正在显示,但背景没有消失.CSS文件是默认的1.4.0 / bootstrap.css

I'm not sure but if you are trying to fade in the image you need to utilize the 我不确定,但如果你试图淡化你需要利用的图像

.fadeIn()

method 方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM