From the course: JavaScript: Enhancing the DOM (2013)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Adding an image

Adding an image

From the course: JavaScript: Enhancing the DOM (2013)

Start my 1-month free trial

Adding an image

In the last movie we created an overlay and placed it on top of our window. What we want to do now is add the image on top of that overlay. To do that we're going to need to figure out where our large image is. Now if you take a look at my project you can see that I have a bunch of images here. When I click on one you see the overlay, but I need the big image right here. So my images have been very carefully saved in the same folder as the other images. So you could see here, here's the artwork section. So if I got a thumbnail called Baird Bellingham_tn.jpeg the large version of the image is the same name without the underscore thumbnail. First I need to find out he name of the item that I clicked on. That is stored in the event target. You can see right here that we were able to figure out the tag name of the image by querying the event target. And then the property tag name. So right over here. I want to create a new variable. I'm going to call it Image source. And I'm going to set…

Contents