Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a bug If you set fade:true and slidesToShow:3 #2393

Closed
lab21gr opened this issue Jun 28, 2016 · 9 comments
Closed

There is a bug If you set fade:true and slidesToShow:3 #2393

lab21gr opened this issue Jun 28, 2016 · 9 comments

Comments

@lab21gr
Copy link

lab21gr commented Jun 28, 2016

Hi there

i have a case where i need to fade my slides, but each slide should have 3 items inside.
But by using [fade: true, slidesToShow: 3]
create an issue.

If you use the settings below, then only the first element of each "slide" will show.
the second and third will get negative left position and opacity=0

$(".slider").slick({
autoplay: false,
fade: true,
slidesToShow: 3,
slidesToScroll: 3
});

You may see the reproduced issue here:

http://jsfiddle.net/lab21/ew3jhcvx/3/

I thought that i would have 3 items next to each other that will fade for the next group to show....

This happens in all browsers, using the latest jquery & latest slick.js

thank you

@leggomuhgreggo
Copy link
Collaborator

Hey @lab21gr fade only works with slidesToShow: 1, but--although complicated--you can hack it with custom CSS to fade if you'd like. Thanks!

@larsmiller
Copy link

I came up with a CSS/JS solution to this issue. These are settings for a speed of 300 and an autoplay speed of 3000 using slidesToShow > 1 and fade: false;

CSS

<style>
.slick-slide {
   opacity: 1;
   transition: opacity 300ms ease-in-out;
}
.slick-slide.opacidown {
  opacity: 0;
}
</style>

jQuery

// this is for the first fadeout
setTimeout(function(){
  $('.slick-slide').addClass('opacidown');
},2700);
// all the rest of the transitions after the initial
$('.element').on('afterChange', function(event, slick, currentSlide, nextSlide){
  $('.slick-slide').removeClass('opacidown');
  setTimeout(function(){
    $('.slick-slide').addClass('opacidown');
  },2700);
});

@luchomatic
Copy link

I had the same problem, I'll try to implement the fix provided by @larsmiller, but it would be awesome if you guys could solve this in the core of the slick slider. I'm always recommending it against Owl slider but this is a major issue.

@janstieler
Copy link

@kenwheeler say it will not be implemented because its not a bug its a feature.
But I think your slogan "the last carousel you'll ever need" is gone with this statement.

@yusufmalikul
Copy link

yusufmalikul commented Jul 23, 2019

@kenwheeler say it will not be implemented because its not a bug its a feature.
But I think your slogan "the last carousel you'll ever need" is gone with this statement.

it's just marketing gimmick.
ps: i use slick.js

@s-a-s-k-i-a
Copy link

even though a marketing gimmick.. I think this is rather a bug than a feature.. at least a not fully thought through feature.. and I am also hoping that @kenwheeler will rethink this and implement compatibility between fade and slidestoscroll > 1

thanks!

@pablo-miralles
Copy link

It will be interesting to have this as a feature. Being able to show multiple slides but using the fade animation will be so useful

@odn808
Copy link

odn808 commented Jul 21, 2022

slick.js always makes slide the first layer children of the target object.
so you can make your DOM like this:

<ul id="slick_target">
  <li>
      <div>slide photo</div>
      <div>slide photo</div>
      <div>slide photo</div>
  </li>
  <li>
      <div>slide photo</div>
      <div>slide photo</div>
      <div>slide photo</div>
  </li>
  ...
</ul>

and use the option "fade:true".

@s-a-s-k-i-a
Copy link

@odn808 Brainz! Why didn't I think of this! Thanks, mate. Super easy solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants