jQuery fadeIn 在 Internet Explorer 中不工作

标签 jquery css internet-explorer fadein

我有以下 HTML DIV,它不能在 IE 中使用 FadeIn:

$(".tip").fadeIn("slow"); /* Is not working in IE. */
$(".tip").show(); /* Works well in IE, that's weird. */



<div class="tip"  style="width: 220px; display: none;">
            <div class="tip-header">
                <span><b>Title</b></span>
                <div class="right close"><a href="javascript:void(0);">close</a> <img alt=""  src="/Images/close-normal.png"/></div>
            </div>

            <div class="tip-content">EBody comes here.</div>
        </div> 


.tip
{
    display: block; 
    z-index: 99999; 
    position: fixed; 
    background-color: #ffffff; 
    -moz-box-shadow: 2px 2px 10px 2px rgba(0, 0, 0, 0.6); 
    -webkit-box-shadow: 2px 2px 10px 2px rgba(0, 0, 0, 0.6); 
    border:solid 1px #82C2FA;
    -moz-border-radius: 8px; 
    -webkit-border-radius: 8px; 
}

.tip-header
{
    padding: 8px; 
    min-height: 10px; 
    -moz-border-radius-topleft: 8px; 
    -moz-border-radius-topright: 8px;
    -webkit-border-radius-topright: 8px;
    -webkit-border-radius-topleft: 8px; 
     background-color: #CFE6FD; 
     border-bottom: 1px solid #82C2FA;  
}

.tip-header span
{
    font-size: 14px;
    color: #666666;
}

.tip-content
{
    padding: 8px; 
    text-align: left;
    font-size: 12px;
}

.close, .whats-this
{
    cursor: pointer;
}

.close a
{
    color: #085FBC; 
    text-decoration: none;
}

.close img
{
    vertical-align: bottom;
}

最佳答案

只需删除 $(".tip").show(); 行,它隐含在 FadeIn() 方法中。

这是一个工作示例 (IE8)

http://jsfiddle.net/Cxvdk/1/

关于jQuery fadeIn 在 Internet Explorer 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2870814/

相关文章:

javascript - 如何通过 URL 将变量传递给数据表搜索字段?

javascript - 点击展开图片

javascript - 通过选择带有 Id 的图像来更改带有 Id 的文本

html - 像 youtube 一样滑动菜单

javascript - 如何通过 PHP 填充 Bootstrap 弹出窗口

html - 恢复 Google AMP 上的广告

html - 有没有办法在右下角和左下角对齐文本?

html - IE 不会将 RTL 段落环绕在 float 元素周围

html - Internet Explorer 中的 CSS 下拉菜单偏移,其他工件也是如此

html - IE 6 中的 float LI