Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
If you're using an earlier version of Dreamweaver or if you're following along on a different tool, you can actually type in these codes, and in case you're doing that, I'm going to be typing these codes manually as well. So, for the document ready in jQuery, it's dollar sign, document inside of parentheses, .ready, and then beginning and ending parentheses, then a semicolon. Then inside of the parentheses, inside of ready, we're going to type function, beginning and ending parentheses, beginning and ending bracket, and then we're going to split this open.
So, what this is going to do is this is going to wait for the entire document object model to be loaded inside of the browser and then it's going to execute these jQuery statements. So, inside of the document ready, we're going to start by typing in another dollar sign, beginning and ending parentheses. Inside of the parentheses, we're going to type two tick marks for a string literal. We're going to type .carousel_data and then a space. We're going to type .carousel_item.
These correspond to the individual divs inside of carousel data that we pasted in from the snippets. So, we're searching for every carousel item inside of carousel data. After the parentheses, we're going to type .each, beginning and ending parentheses, semicolon. Inside of the each statement we're going to type function, beginning and ending parentheses, beginning and ending bracket. Let's split that open. So, each time we find a carousel item inside of carousel data, we want to do this instruction.
So dollar sign, beginning and ending parentheses, two tick marks for a string literal, pound sign, carousel. We're going to target the carousel container. Outside of the parentheses, .append, beginning and ending parentheses, semicolon. And what we're going to so inside of the carousel_item is we're going to append the following statement. So, let's open up the parentheses a little bit inside of append, and we're going to type dollar sign, beginning and ending parentheses.
Inside of the parentheses, we're going to type this.find, beginning and ending parentheses. Inside of the parentheses for find, two tick marks for a string literal. We're going to look for the .image class. Outside of the parentheses for the image item that we're finding, .html, beginning and ending parentheses. So, what this is actually going to do is go through the carousel data, find every carousel item, and for each one that's found, we're going to find the div with the image class, take whatever the HTML is inside of there--which in this case is going to be the image tags--and we're going to put those inside of the carousel container that has the id carousel, and that's going to actually create all of the teapot graphics in the carousel items so that Roundabout plug-in can arrange them in the circle.
So, now that we have this script in place that we will take all of the images and put them in the carousel, in the next movie we'll initiate the Roundabout plug-in based on all of those images that we just put inside of the carousel.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.