Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Once our script is complete, we'll come back here and take out this comment. Now at the top of the script, we have a bunch of variables that we've declared. Let's hit a Return and let's declare one more variable, var photoWidth. We are going to set that equal to 0. Now we do use a variable later on in the script called marqueeWidth. We're going to be replacing that with this more global variable so that we can actually use this in a couple calculations that we are going to need to get this wraparound effect to work. So now that we've declared a variable called photoWidth, let's scroll down and inside of the document-ready function, let's hit a few returns after the setinterval, and what we want to do here is set the width of that based on the actual width of the marquee container.
So let's type window.photoWidth. We are going to set that equal to dollar sign, parentheses, tick marks inside for a string literal. We are going to do .marquee_container. Outside of the parentheses, .width, beginning and ending parentheses, then semicolon. So once the jQuery document-ready is done running, we're going to take the global variable photoWidth and set it to the width of the marquee container.
So now that we've disabled autoplay by commenting outset interval, we've set a new variable called photoWidth and set the value of that using jQuery to determine the marquee container width. In the next movie, we are going to go into the photo lineup statements and actually rearrange the photography.
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.