淡入淡出效果;I don’不要在IE8上眨眼

Fade in and Fade out effect doesn't work on IE8 for a text blink?

本文关键字:IE8 淡出 don 淡入      更新时间:2024-03-30

到目前为止,我所做的是

<script type="text/javascript">
$(function() {
blinkeffect('#txthelpline');
});
function blinkeffect(selector) {
    $(selector).fadeOut('slow', function() {
        $(this).fadeIn('slow', function() {
            blinkeffect(this);
        });
    });
}

 <a href = "javascript:void(0)" id="txthelpline" 
            onclick ="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'"        
                 style="color:yellow; margin-left:110px; font-size: large; font-weight: bold; font-family: 'Times New Roman', Times, serif; ">Helpline Numbers</a>

帮助热线号码文本在谷歌chrome上成功闪烁。但它在IE8上不起作用。

在IE8中,该特定动画不适用于<a>标记。我不确定为什么会这样,但可能是因为它不是块元素,而是内联元素。在任何情况下,如果将链接放在<div>中并改为对该<div>容器设置动画,则动画将起作用。

以下是您更改为<div>的链接:https://dl.dropboxusercontent.com/u/7909102/test2.html将在IE8中动画化。