Design comparison
Solution retrospective
I enjoyed doing this challenge, but haven't understood how to implement a lightbox gallery with multiple images. I'll be happy, if you help me with this problem and point out other mistakes
Community feedback
- @skyv26Posted almost 3 years ago
Hi! Andrew, Really awesome work and I appreciate your work and I checked all hover states that were required. I have not noticed any issue and as you wrote above you weren't able to implement the lightbox gallery. I made this project using ReactJS and I also faced to much problem while working on this challenge. I have suggestion for you.
-
Just make JS variable which hold HTML elements for your sneakers images, and just append variable contents, into the place where your required to make it visible or you want to implement lightbox gallery, and if user click on any image in lightbox gallery then same will update on the main page gallery. Simply making a string of html content can be easily used multiple times and help you to implement the lightbox gallery.
-
You did mistake in your code and you can also check your report, in order to get know, as I found you did below in your html
<a class="item__preview-main__lightbox" href="./images/image-product-1.jpg" data-lightbox="sneakers">
href is meant for hyper links or for refer to webpage particular section using id . So fix it and it will fix your issue too.
Overall Really nice , Good Job and I hope you understand the issues.
Good Luck
Marked as helpful1@andy-devsPosted almost 3 years ago@skyv26 Hi, thanks for your feedback! Your suggestion helped me out. Now I understand how to implement a better version of lightbox gallery. I included image in href because I think it's a requirement of Lightbox2 library to show image on click properly (https://lokeshdhakar.com/projects/lightbox2/). However, maybe I should have found another way to do it. Thanks again!
1 -
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord