Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
In this movie we're going to layout the HTML for our gallery. This will include the necessary structure to handle the 3D transforms, as well as the images themselves and the buttons in the control section. Let's start by opening the spotlight.htm file from the Chapter 05/05_02 folder in the exercise files in my code editor. Let's hit down to around line 36 where I've got a placeholder waiting. Insert carousel HTML here. Let's remove that so we can start coding. First, I'm going to add two sections using the appropriately named HTML 5 section tag.
I'll give the first a class of container and then open up the section and make a little room, go past it, and let's put it in our second section. And this will have a class of options, and again I'll open that up. All right, now let's add a div within the first section to hold the carousel. This will give an ID of carousel, and let's open up that as well. Now we're ready to add in our figures. Each figure tag will have an identifying ID and contain an image tag.
These will all go within the div carousel. So I give this first figure an ID of fig1, and then move my cursor within the figure tag and put in my image tag, and this will have a source located within the _images folder, and it is artwork1. Next I'll give it a width of 274 and a height of 174. All of the images have the same width and height. Now they also share a common naming convention, artwork1, artwork2 and so forth, which makes putting in the remaining 9 images, a copy and paste affair.
So let's copy that line, so what I'm going to do is go ahead and paste in a line for each of the remaining images, and then come back and renumber them. That's my third one, four, five, six, seven, eight, nine, ten. fig1 goes to fig2. And artwork1 becomes artwork2. Let's do the same thing for the artwork. We'll change that to artwork3, and then press my down arrow and change the next to 4 and so on. All right, those are all done. Now we also need to add a class that will be used to identify this slide that is to be shown, which is used both to isolate the scale up hover effect and to enable the show on older browsers.
So I'm going to add that class to the very first figure. Since that's what we'll be showing when the page loads. And this is a class called ShowFig. All right, let's skip down to our options section and bring in our buttons. Again, we'll identify the elements with IDs. First I'm going to start with a paragraph tag with an ID of toggle. Within that paragraph tag I'll put in my button with an ID of toggle-axis. And within the button tag, the label itself, Toggle Axis.
Get unlimited access to all courses for just $25/month.Become a member
58 Video lessons · 66030 Viewers
61 Video lessons · 96634 Viewers
56 Video lessons · 110349 Viewers
82 Video lessons · 105126 Viewers