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

Erik Nuber
Erik Nuber
20,629 Points

Need help with Image Carousel

I have uploaded my workspace.

The area in question is towards the bottom of the javaScript file. I have appended arrows and, when you click them, they are traversing the DOM correctly. I have checked via the console. However, the images aren't sliding. I am not sure what it is I am doing wrong.

I have tried adding in jQuery .css statements, animate statements and nothing is working.

As for traversal, it grabs everything within the li tags and, it marks the current li tag as checked and unchecks where it came from. I'm not yet sure that is needed but, have added it in. I am currently also working on the left arrow as I assume once I can figure that out it won't be to difficult to then rewrite for the right arrow.

I have created a series of nav-dots as well that allow the carousel to be moved when clicking a dot. As the site is responsive, when you decrease the width of the browser a smaller carousel pops up that runs automatically and is paused when hovered on. Everything else works great.

So any help would be appreciated.

https://w.trhou.se/txrdoojk34

rydavim
rydavim
18,814 Points

Can you elaborate on what the website is suppose to look like, and any functionality? Unfortunately, your images weren't uploaded, so it's difficult to know what the carousel is meant to look like.

I tried adding my own photos, but I'm not even getting the arrows you mentioned. If you could upload your most current files, and confirm that they're working as well as you expect I can take another look.

If you're not able to get an accurate copy of your files up here, I can talk more generally on how you might go about this, but it might get tricky to find the specifics.

Erik Nuber
Erik Nuber
20,629 Points

I gave up and ended up just using the slick carousel. I wanted to actually create it by myself but realize that most people likely use code that is already written. I think I was trying to do to many things within the carousel that was causing problems as the images were loaded as background images. I was also running transitions on top. But thank you for the response.