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

Chapter 3. Fun with Images > Using a Function to Code Multiple Images with a Si...

Using a Function to Code Multiple Images with a Single Rollover

The last couple of examples used a fair amount of code that was almost identical. As you may remember from Chapter 2, repetitive tasks are perfect candidates for functions. Once you write the code that accomplishes the repetitive task, you just call the function, and pass it any data that it needs to do its job. Script 3.7 does the same job as Script 3.4, but it uses a function to streamline the code a bit. The visible results are the same as in Figure 3.7.

Script 3.7. Using a function helps you streamline your code.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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