Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Next we're going to type variable totalPanels. We're going to set this equal to zero to start and then we'll have our jQuery actually generate the total number of panels by modifying the script below. Next we're going to set autoPlay. We're going to set this equal to True. Next we'll set timePassed. we'll set that equal to zero as well.
Next we'll type variable timeToChange. We're going to set this to 3. This is going to be three seconds, so that the marquee will play every three seconds. This will be too fast for our end project, but we wanted to set something quick while we're testing and debugging this so we can actually make sure that it plays properly and it doesn't take a lot of time to play through. Now inside of the (document).ready, we want to set up a few statements here that will send these variables over to the HTML page. These are going to be part of our debugging scripts. So I'm going to type a forward slash and an asterisk, type debug and then asterisk and forward slash. This is going to put a small comment in the beginning of this line.
And I'm going to put this debug comment before every time we send data over to the HTML, so that we can go back later and be able to remove these. So I'm going to start by typing a dollar sign, beginning and ending parenthesis. Inside of the parentheses we'll type two tick marks. I'm going to type autoPlay and this is the autoPlay class from the debug area in the HTML, not the variable that we have set up above here.
Again, by typing window here we can go out to the global script area. Now that we have the first debug statement set up, let's copy this. Command+C or Ctrl+C to copy. We're going to paste two, three more of these to give ourselves a total of four. We have five of them up here, but we're going to set the total panels a little bit later. So now Dreamweaver gives us a really nice way to select variable names and class names and element names. I'm going to come up here. I want to set the timePassed variable, it being the second one.
Let's come down and paste currentPanel on the fourth item here. At this point let's choose File > Save. So now at the beginning of the document we have our global five variables set up. We're going to set the state of these variables to debug in the HTML when we load the page. And in the next movie we're going to modify the existing script to get the total panels and the actual current panel based on the navigational item that was clicked.
Get unlimited access to all courses for just $25/month.Become a member