Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
So, what a setinterval is doing is it's basically going to run a function, any function name we want, which I put here, autoAdvance, and it's going to run it every 1000 ticks or once a second. So, this is going to continually run the whole time somebody is sitting on this web page. Now outside of the (document).ready, after all of the variables that we declared, we are going to create that custom function. So, we are going to type function autoAdvance, beginning and ending parentheses, beginning and ending bracket.
Let's open this up. So, now this function is going to run every second. So, in order to test this, let's type alerts, beginning and ending parentheses, semicolon, and inside let's put two ticks for a string literal. I will just type a set interval ran. So, we will choose File > Save. Let's go back to the Index file. Let's run this in a browser and what we should see is a pop-up window coming up every second-- I will hit Reload-- saying set interval ran.
Click OK, one second, pops-up again. click OK, one second, pops up. So, again, this is going to run every second constantly the whole time. So, I will click OK and then close the window. Let's go back to Dreamweaver. Let's go back to our marquee.js. Now, that we have the setinterval running this function every second, in the next movie, we are going to setup some logic inside of autoAdvance to actually change the state of the marquee.
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.