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
James Kim
8,475 PointsJquery slick carousel problems
After taking Jquery plug in course, I wanted to try using Slick carousel on my own, but it doesnt seem to work properly. The dots are not actual dots, and autoplay does not autoplay... well it does after refreshing the page a couple of times.
The slick-1.5.0 folder is in the same folder as the html, css, and js file.
the code is on the bottom.
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<link rel = "stylesheet" href = "slick-1.5.0/slick/slick.css">
<link rel = "stylesheet" href = "slick-1.5.0/slick/slick-theme.css">
<link rel = "stylesheet" href = "puphcss.css">
</head>
<body>
<div class = "container" id = "slider">
<div class = "slides">
<div class = "slide"><img src = "https://download.unsplash.com/photo-1428604467652-115d9d71a7f1"></div>
<div class = "slide"><img src = "https://download.unsplash.com/photo-1428591501234-1ffcb0d6871f"></div>
<div class = "slide"><img src = "https://download.unsplash.com/photo-1423882503395-8571951e45cc"></div>
<div class = "slide"><img src = "https://download.unsplash.com/photo-1422433555807-2559a27433bd"></div>
</div>
</div>
</body>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src = "slick-1.5.0/slick/slick.min.js"></script>
<script src = "puphjs.js"></script>
</html>
img{
max-width: 100%;
}
.slide{
width: 50%;
}
.slick-dots li button:before {
font-size: 25px;
}
$(".slides").slick({
autoplay: true,
autoplaySpeed: 1000,
dots: true
});
Thank you
1 Answer
Ryan Field
Courses Plus Student 21,242 PointsYou can't have spaces between attributes and their values, which is probably causing your errors.
So, you need to change all of your tags that look like this:
<link rel = "stylesheet" href = "slick-1.5.0/slick/slick.css">
to this
<link rel="stylesheet" href="slick-1.5.0/slick/slick.css">