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

Design

Nathan Begnaud
Nathan Begnaud
8,221 Points

How Do You Make an Image Expand When You Click on It?

I can't seem to find the answer to this question anywhere. I want to make my images and video expandable when clicked on just like this website here: http://www.destinythegame.com/uk/en/media/official-live-action-trailer-become-legend Is it really complicated to do?

2 Answers

After inspecting that site you gave I realized it is a trick they are doing. The image-video never expands.What happens is they have put a thumbnail of the video such as this and when you click on it, it loads an embeded video player which is the one you see on top, with the link of the video that relates to the image you clicked. You can check out this page, Triggering a Youtube Video from Clicking a Button Image and Replacing when Ended, I think it might help give you an idea of how to go about it, it is not exactly what you are trying to do but if you change the width and height of the video player, plus some other tweaks, you might be able to do something similar.

Bill Hinostroza
Bill Hinostroza
19,273 Points

In order to do this you're going have to use jquery and probably ajax.