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

Mayur Pande
PLUS
Mayur Pande
Courses Plus Student 11,711 Points

lightbox project, can I make next buttons

On the lightbox project. would I be able to create "next" and "previous" buttons" so that I can go on to the next photo in the ul, but make sure that it stays in the lightbox mode?

1 Answer

Steven Parker
Steven Parker
229,732 Points

You certainly could add buttons like that if you want.

You might have the buttons be part of the overlay, along with the image and caption. Then have the click handlers for those buttons just replace the image and caption without dismissing the overlay itself.

Mayur Pande
Mayur Pande
Courses Plus Student 11,711 Points

Steven Parker sorry for late reply, thanks for the answer, think I got the gist of it. Will give it a go!

Mayur Pande
Mayur Pande
Courses Plus Student 11,711 Points

Steven Parker Would I have to do something different to this, if I wanted to be able to implement swipe gestures for mobile?

Steven Parker
Steven Parker
229,732 Points

There's currently no "swipe" event in JavaScript, but there are a number of libraries available for detecting them, including jQuery.