Web Tech II Class 06 Javascript animation and gameplay
Short Description
that sort of an approach is that it allows for animation to be created via javascript. That can be used in order to create unique …
Website: www.purplestatic.com | Filesize: 77kb
Content
Web Tech II - Class 06: Javascript animation and gameplay
J. Adrian Herbez - purplestatic@yahoo.com
Sometimes you might find that you want to have a javascript function happen every so often. There are various reasons that you
might want to do that (redirect a user to another site after a certain amount of time, for example), but one of the great things about
that sort of an approach is that it allows for animation to be created via javascript. That can be used in order to create unique
interfaces or even full-on games.
Using the timer
Usually, javascript executes in response to a user event, such as a mouse click or a mouse over. It can also be called by forms,
and when a page loads. However, you can also tell a given function to run itself a set time from the present. To do that, you need
to use the setTimeout() function, which takes two arugments:
1) the function (or line of code) to run
2) the number of milliseconds (1000 millliseconds = 1 second)
So, if you had a function named myDelay() and you wanted it to happen 3 seconds from some…
Get the file Download here
Related Books:Related Searches: javascript animation, settimeout function, javascript function, content web, page loads
Comments
Leave a Reply