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
Todd Moody
8,169 PointsDisplay full size image on thumbnail click
Hi there,
Great tutorial. I know it's not part of the lesson but would it be possible (using the public photos feed) to display a full size image in a lightbox when the user clicks the thumbnail?
In the JSON feed I can't see any reference to anything other than the thumbnail so I wonder if another flickr method would need to be called to achieve this.
Thanks a lot
3 Answers
Richard Looper
2,046 PointsYou should make the call to the GetSizes API. Extract the Label= and source= pair and use to display the desired image size in the light box. Resist scaling small images. scale only from a starting size close to your desired size. (Tip: Scaling the image down always looks better than a scaled up image. But, You will need to balance the size with the performance of image transmission across the net.) The Flickr API reference is https://www.flickr.com/services/api/flickr.photos.getSizes.html
Anjolaoluwa Akinremi
8,532 PointsIt is not impossible. I would suggest taking out the data (link) of the image that leads to the Flickr website and watch the tutorial on How to Create a simple Lightbox which should be in jQuery Basics. You will be able to do it.
Todd Moody
8,169 PointsHi Anjolaoluwa,
Thanks a lot for the response and I'll definitely check out that tutorial.
Cheers, Todd
Aleksandr Antonov
15,876 PointsIt is possible if the size of the image that you have received allows for scaling. The logic is simple if your received an image once you can reuse it in multiple instance. The only but is it's size. If the image is too small it obvious that you wont be able to scale it up (aesthetic reasons)
Todd Moody
8,169 PointsGreat, thanks Aleksandr
Todd Moody
8,169 PointsTodd Moody
8,169 PointsGreat thanks Richard, appreciate the response.