The Hierarchy Statement
In this Tip we'll quickly discuss the use of those objects in what I call a hierarchy statement. Here's a very bare-bones image flip script:
Remember from the last Tip that document is an object? Well, it is. Here, we're using the document object to set up a hierarchy statement. "Hierarchy statements" are listings of elements under a specific object. This statement, for instance, is under the object document -- the HTML document.
In these statements it's always biggest to smallest, reading left to right. So, in this case, the statement is saying:
- The document...
- that contains something called pic1...
- receives this source (denoted by src)...
- an image called menu1on.gif.
Notice it's always a dot (.) that separates the items in the hierarchy statements. I should say here that the pic1 item is the name of the image command. See that in the full code above?
Next Time: More On The Image Flip