Bootstrap模态与背景渐隐 [英] Bootstrap modal with background fading in

查看:187
本文介绍了Bootstrap模态与背景渐隐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用bootstrap 1.4.0和jquery 1.7.2。我试图创建一个具有褪色背景的模态窗口。

I'm using bootstrap 1.4.0 and jquery 1.7.2. I'm trying to create a modal window with fading background. The modal window should be loaded using javascript function.

这是代码我有:

<!-- 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>   

模态正在显示,但背景未消失。
CSS文件是默认一个1.4.0 / bootstrap.css

The modal is showing but the background is not fading in. The CSS file is the default one 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()

方法

这篇关于Bootstrap模态与背景渐隐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆