js代码
<script src="js/jquery-2.1.1.min.js" type="text/javascript"></script> <script src='js/slick.min.js'></script> <script type="text/javascript"> (function() { var slideContainer = $('.slide-container'); slideContainer.slick(); $('.clash-card__image img').hide(); $('.slick-active').find('.clash-card img').fadeIn(200); // On before slide change slideContainer.on('beforeChange', function(event, slick, currentSlide, nextSlide) { $('.slick-active').find('.clash-card img').fadeOut(1000); }); // On after slide change slideContainer.on('afterChange', function(event, slick, currentSlide) { $('.slick-active').find('.clash-card img').fadeIn(200); }); })(); </script>