Jquery Testimonial fader does not work smoothly

后端 未结 3 1170
心在旅途
心在旅途 2021-01-27 02:58

I use jquery to rotate my div one by one using fade effect but the effect is not smooth it jumps up and down and then display here is my fiddle.

http://jsfiddle.net/xXRw

3条回答
  •  迷失自我
    2021-01-27 03:32

    Just use an interval to show and hide methods:

     $('.testimonials div:first').show();
    
    setInterval(function(){ $('.testimonials div:first-child').fadeOut(1000).next('div').fadeIn(1000).end().appendTo('.testimonials') },3000); 
    

    Or better, if you don't want to view the jump:

     $('.testimonials div:first').show();
    
    setInterval(function(){ $('.testimonials div:first-child').fadeOut(1000).next('div').delay(1000).fadeIn(1000).end().appendTo('.testimonials') },3000);
    

    JSFIDDLE: http://jsfiddle.net/xXRwA/4/

提交回复
热议问题