• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 14. Dynamic Techniques: Advanced > Making a Function Run Again

Making a Function Run Again

To create a dynamic function, you often need to have that function run repeatedly until, well, until you don't want it to run anymore (Code 14.1). This recursive running of the function allows you to animate objects or allow objects to wait for a particular event to happen in the browser window before continuing (Figure 14.1).

Code 14.1. The setUpAnnoyingFlash() function prepares the initial values of variables that are then run in the annoyingFlash() function. annoyingFlash() keeps running, and running, and running… causing the image to appear and disappear at 1-second intervals until the visitor clicks the image while it is showing.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint