javascript - Jquery focus map fade in and fade out effect, please give me some advice
大家讲道理
大家讲道理 2017-06-28 09:25:51
0
2
820

The timer runs back every 3 seconds:

    var i = 0,
    t = setInterval(function () {
        i++;
        i===3 ? i=0 : false;
        $('.slide li').eq(i).fadeIn(300).siblings('li').fadeOut(300);
    }, 3000);

But the effect will be flashy white, and the transition is not natural at all. I need a very natural transition effect.

Example of such effect: http://www.5icool.org/demo/20...

Am I using the wrong method?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
我想大声告诉你

The effect is described in the link below

.slide{
    position:relative;
}
li{
    position:absolute;
}
仅有的幸福

Fade in and out is to change the transparency, you can try to use css3 transition
var i = 0,

t = setInterval(function () {
    i++;
    i===3 ? i=0 : false;
    $('.slide li').eq(i).addClass("opacity").siblings('li').removeClass("opacity");
}, 3000);

<style>
 .slide li{transition: all .3s; opacity:0;}
<style>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template