Jquery 交叉淡入淡出图像与匹配图像淡入淡出

Jquery 交叉淡入淡出图像与匹配图像淡入淡出,jquery,css,Jquery,Css,我对幻灯片有问题。有没有办法让我看到图像淡入淡出 这是一把小提琴 function cycleImages(){ var $active = $('#cycler .active'); var $next = ($active.next().length > 0) ? $active.next() : $('#cycler img:first'); $next.css('z-index',2);//move the next image up the

我对幻灯片有问题。有没有办法让我看到图像淡入淡出

这是一把小提琴

function cycleImages(){

      var $active = $('#cycler .active');
      var $next = ($active.next().length > 0) ? $active.next() : $('#cycler img:first');
      $next.css('z-index',2);//move the next image up the pile
      $active.fadeOut(1500,function(){//fade out the top image
          $active.css('z-index',1).show().removeClass('active');//reset the z-index and unhide the image
          $next.css('z-index',3).addClass('active');//make the next image the top one
      });
    }

$(document).ready(function(){
// run every 4s
setInterval('cycleImages()', 4000);
})

你有了一个开始,我想一旦你改变了这个,你就会明白:

setInterval('cycleImages()', 4000);
为此:

setInterval(function(){cycleImages()}, 4000);

然后从那里修复代码。

匹配图像,您的意思是相同的是??是。。相同的图像,但我看不到它淡入淡出。。你能帮我吗?问题是你在同一张图像中淡出,所以你想看到淡出。让我看看我们是否可以用不同的方法来做这件事怎么样,只是在一个图像中淡出,然后在后面有另一个图像,透明度更低--仍然不起作用。。你能给我一把这种小提琴的样品吗??您正在使用jQuery,因此必须将其引入。在顶部的左栏中,显示框架和扩展,单击显示“无库(纯JS)”的下拉列表,从下拉列表中选择jQuery 2.1.0谢谢。很有魅力。。我对堆栈溢出还是新手。再次谢谢你……是的,我很乐意帮忙。