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

Chapter 11. Palette Man > Adding Functionality

Adding Functionality

Now let's look at some of the JavaScript. We'll start by just looking at the shiftColor function in Example 11-2, which takes the color the user's mouse is over and translates that to the proper layer's background color. It ends up that this function needs another one: getCurrentLayer looks at which layer is “active,” that is, which radio button is currently checked.

Of course, there's some setting of global variables: We create an array that remembers which layers are locked (color won't change) and some basic browser detection.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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