DHTML Lab: Cross-Browser Visibility Transitions; Explorer Reveal Transition Filters I
Cross-Browser Visibility Transitions
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Explorer 4 introduced visual and transition filters with CSS syntax. In column 13, Dynamic Headline Fader, we introduced transition filters. It is highly recommended that you re-read the short transition overview page, in that column, as it introduces concepts that will be discussed in the present column. Reveal TransitionsTransition filters come in two flavors, the Blend transition filter and the Reveal transition filters. The Blend Transition, which simply fades one state of an HTML control to another, was used for our fader technique. In the present column, we will use the Reveal Transitions. Reveal Transitions are defined exactly as the Blend Transition is, with one additional property, transition, which specifies which of the twenty-three available transition types should be used (0-22). A twenty-fourth value (23) causes a random transition to be chosen. The table in the left column lists all the values for transition and the transition type they are associated with. Filters are defined using CSS syntax as part of an element's style. To define a reveal transition filter for an element, we can use either of the following methods: 1. Define filter as a declaration in a style rule in the STYLE tag or external stylesheet: <STYLE> elementIdentifier { filter:revealTrans(duration=seconds,transition=type); } </STYLE> 2. Define filter as a declaration in an in-line STYLE=: <TAG STYLE="filter:revealTrans(duration=seconds,transition=type"> 3. Define filter dynamically in a script: elementReference.style.filter = [keep with next line] "revealTrans(duration=seconds,transition=type)"; If, for example, we have a positioned element called elTrial, for which we want to define a three second "wipe down" effect, we can use the following script syntax: elTrial.style.filter = [keep with next line] "revealTrans(duration=3,transition=5)"; Applying the filterOnce an element has a filter associated with it, we can invoke the transition, through script, at any time by using the apply() and play() methods of the filter. Even though we define a filter using an element's style, we invoke it through the filters property of the element itself. This property contains all the filters associated with an object. In our case, we are concerned with the reveal transition filter, which is reflected into JavaScript as: elementReference.filters.revealTrans. As you will recall, transition filters work in this way:
Our TechniqueIn our technique, we will be using the reveal transition filters for one purpose only: to invoke transitions of positioned elements from a visible state to a hidden state. This is only one minor possible use of the filters. We will apply them only to positioned elements and then only use them to hide the elements. The exceptions are reveal transitions 1, 3, 14, and 16. These will be used to make elements visible. We are limiting ourselves to this single use, since ultimately we will be creating a cross-browser script that simulates these transitions for Navigator, which has no built-in transition abilities. When we are done, we will have created an external script, a library of transition routines, that can be used to hide your positioned elements with a little more flair than the usual visibility="hidden";. All of this, of course, will fall into place as we build our script. |
Produced by Peter Belesis and
All Rights Reserved. Legal Notices.Created: Apr. 28, 1998
Revised: Apr. 28, 1998
URL: https://www.webreference.com/dhtml/column19/transIEone.html