Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
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.
Find answers to the most frequently asked questions about Set a Marquee to Autoplay with jQuery and Dreamweaver.
Here are the FAQs that matched your search "":
Sorry, there are no matches for your search ""—to search again, type in another word or phrase and click search.
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.