|
December 15, 2000 Controlling Element Visibility Tips: December 2000
Yehuda Shiran, Ph.D.
|
|
The browser-independent W3C Standard's way to set and get an element's visibility is via the style object's visibility property. The visibility property may have three possible values:
An element is visible when its
Click the left button to hide and reveal the right button: The algorithm is straightforward. When the user clicks the left or right button, we ask in handleClick() whether the visibility property is not "hidden". If it's not "hidden", we set its property to "hidden" and switch the value of the left button to reflect the change ("Show Other Button"). If the right button is "hidden", we set its property to "visible" and switch the value of the left button, accordingly, to "Hide Other Button". This script does not work on Mac IE4.5.
People who read this tip also read these tips: Look for similar tips by subject: |
| ||||||||||||||||||||