Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Using jQuery Plugins Using a jQuery Carousel The Carousel Challenge Solution

SAHIL SANWAL
SAHIL SANWAL
6,116 Points

slideToShow not working on home page

i tried the slides to show on home page and it did not work for some reason. here is the code $('.slides').slick({ fade: true, autoplay: true, autoplySpeed: 1000, arrows: false, dots: true, // infinite:true, slidesToShow:2, slidesToScroll:2 });

Shawn Flanigan
Shawn Flanigan
Courses Plus Student 15,815 Points

Sahil: Can you share your code with us? I'll take a look and see if anything stands out.

SAHIL SANWAL
SAHIL SANWAL
6,116 Points

$('.slides').slick({ fade: true, autoplay: true, autoplySpeed: 1000, arrows: false, dots: true, // infinite:true, slidesToShow:2, slidesToScroll:2 });

3 Answers

Daniel Mitchell
Daniel Mitchell
5,834 Points

What exactly isn't working? Is one of the settings you are applying not working or are the slides not displaying at all?

Matthew Brock
Matthew Brock
16,791 Points

The "fade" option does not seem to work with the "slidesToShow" options. Remove your "fade" option and it should work fine.

Rafael Ferreira
Rafael Ferreira
13,086 Points

You kept a comma after the dots: false configuration. That will create a error and won't let the carousel work. Try this:

$('.slides').slick({
 fade: true, 
 autoplay: true, 
 autoplaySpeed: 1000, 
 arrows: false, 
 dots: true 

 });

I usually do each config option in a separated line, it's easier to read. Hope it helps!