Although it??™s easy to change the depth of an AP element??”its Z index??”in the design phase, having an AP
element pop to the front is also a desirable dynamic effect. Massimo has designed a cross-browser behavior
that enables Web designers to control AP element depth interactively. Set Layer Z Index is a relatively simple
but elegant behavior and, as such, perfect for understanding how behaviors, in general, are constructed.
Dreamweaver includes a standard behavior??”Change Property??”that can also change the Z
index of an AP element, but it doesn??™t work across browsers. To get the same effectiveness as
Massimo??™s behavior, you??™d have to apply Change Property twice: once for Netscape browsers and again for
Internet Explorer.
Step 1: Define the behavior
Behaviors are born of need, desire, or a combination of both. After repeating a single operation a thousand
times, you probably find yourself thinking, ???There??™s got to be a better way.??? The better way usually automates
the process. In the case of inserting JavaScript functions into Web pages, the better way is to create a
behavior.
Starting from this vantage point already accomplishes the first phase of behavior creation: defining the
behavior. If you were to add the necessary code to a single page to change the Z index of an AP element
dynamically, it would look like the following code.
Pages:
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900