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

Question about jQuery LightBox implementation

I want to create a dynamic image gallery with a navigation bar that loads a different gallery corresponding to each link. For example, if the user clicks on the link "Black&White", a predefined set of pictures will load and so on.

There are many ways to implement this and I'm trying to find the best practice. Creating an array of images and pasting them into a div with append or hiding/showing divs that exist on HTML both work but they sound like very bad practice. If I concatenate all attributes for an image using join methods, it will take too long for an image like this:

<li><a href="img/256.png"><img src="img/256.png" width="150" alt="Image 01"></a></li>

I really need suggestions for good implementation method. Thanks!