
This section describes the properties, methods, and events associated with the visual and transition filters.
Sets the default length of time the transition will take to complete.
STYLE="FILTER: transitiontype(duration=duration, transition=transitionshape)"
Parameter Description duration Length of time the transition should take to complete. Value, float. Value is expressed in seconds.milliseconds (0.000). Read-write at run time. If transition has been applied or is playing, read-only. transitionshape Shape of the transition (Reveal transition only). Integer. Value from 0 to 23. For information on the available transition shapes, see the Reveal Transition topic.
A transition's playback duration can also be set as a parameter of the Play method.
Transition filters
Specifies whether the filter is enable or disabled
status = object.filter.enabled=fValue
Parameter Description fValue Boolean value indicating whether the filter is enabled (true) or disabled (false). The property is read-write.
<img id=image1 src="sample.jpg" style="filter:blur(strength=50) flipv()"> <SCRIPT> image1.filters[1].enabled = false; // disable the flip filter </SCRIPT>
Transition filters
Returns the current status of the transition.
nStatus = object.filter.Status
Parameter Description status Integer. Values are 0 (transition stopped), 1 (transition applied), or 2 (transition playing). Read-only.
Transition filters
Fires when a visual filter changes state or completes a transition.
This event will bubble. Events that bubble can be handled on any parent element of the object that fired the event.
If you have multiple objects with transitions on a page, you can determine which object fired the Object_onfilterchange event by checking Window.Event.srcElement. The filters and transitions that ship with Internet Explorer 4.0 fire the event when a transition completes, although the underlying architecture allows future filters to fire at any time their internal states change.
<HTML> <HEAD> <TITLE>Microsoft Cascading Style Sheets Controls Samples </TITLE> </HEAD> <Div ID = "TextRegion" STYLE="Position:absolute;LEFT: 0; TOP: 200; WIDTH: 100%; VISIBILITY: visible; FILTER: revealTrans(Transition = 1, Duration = 1.25)"> Some Text </DIV> <DIV ID="ImageRegion" STYLE="Position:absolute;LEFT: 0; TOP: 200; WIDTH: 100%; VISIBILITY: hidden; FILTER: revealTrans(Transition = 1, Duration = 1.25)"> <IMAGE SRC="Image1.jpg"> </DIV> <SCRIPT LANGUAGE=VBScript> Sub Window_onload Call TextRegion.filters.revealTrans.Apply () Region.filters.RevealTrans(transition=23) Call ImageRegion.filters.revealTrans.Apply() Image1.filters.revealTrans(transition=12) Call Start End Sub Sub Start If TextRegion.style.visibility = "visible" then ImageRegion.style.visibility = "hidden" Else ImageRegion.style.visibility = "visible" TextRegion.style.visibility = "hidden" End if Call TextRegion.Style.filters.revealTrans.Play(1.5) End Sub Sub Region_onfilterchange Select case Window.Event.srcElement Case "Region" If Region.filters.revealTrans.Status = 0 then Call ImageRegion.filters.revealTrans.Play(1.5) End If End select End Sub </SCRIPT> </BODY> </HTML>An asterisk in the following applies to list indicates that a defined height, width, or absolute position is required.
BODY, BUTTON, DIV*, IMG, INPUT, MARQUEE, SPAN*, TABLE, TD, TEXTAREA, TFOOT, TH, THEAD, TR
Applies a transition to the designated object.
Call object.filters.item(index).apply()
Parameter Description object Identifier of the object to which the filter is to be applied. index Integer. Index (position in the collection of transitions for this object) number of the transition. Value can be 0-n, where n is the last transition made available to this object.
Transition filters
Plays the transition.
Call object.filters.item(index).play(duration)
Parameter Description object Identifier of the object to which the filter has been applied. duration Float, seconds.milliseconds (0.000). Valid values are 0.0-N.n. Optional parameter, read-write at run time.
If a playback duration is explicitly specified as a parameter of the this method, it will override the Duration property assigned to the transition for that instance of the transition's playback.
Transition filters
Stops transition playback.
Call object.filters.item(index).stop()
Parameter Description object Identifier of the object to which the filter is attached. index Index number of the transition whose playback is to be stopped.
Fires the Onfilterchange event.
Transition filters
Adds an ambient light to the Lights Filter Effect object. Ambient light is nondirectional light that sheds parallel beams perpendicular to the surface of the page. Ambient light has color and strength values and can be used to add more color to the page; it is often used in conjunction with other lights.
call object.filters.Light.addAmbient(R,G,B,strength)
Parameter Description object Name of the object to which the Light filter is applied. R Red value, integer from 0 to 255. 0 is lowest saturation, 255 is highest. G Green value, integer from 0 to 255. 0 is lowest saturation, 255 is highest. B Blue value, integer from 0 to 255. 0 is lowest saturation, 255 is highest. strength Intensity setting.
This example shows how to create a blue ambient light with a fairly low intensity.
call object.filters.Light.addAmbient(0,0,255,10)
Light Filter
Adds a cone light to the Lights Filter Effect object to cast a directional light on the page.
call object.filters.Light.addCone(x1,y1,z1,x2,y2,R,G,B,strength,spread)
Parameter Description object Name of the object to which the Light filter is applied. x1, y1, z1 Source light's coordinates. x2, y2 Target focus coordinates. Note: z2=0 is implied. R Red value, integer from 0 to 255. 0 is lowest saturation, 255 is highest. G Green value, integer from 0 to 255. 0 is lowest saturation, 255 is highest. B Blue value, integer from 0 to 255. 0 is lowest saturation, 255 is highest. strength Intensity setting. Integer value. Note: strength specified pertains to the target coordinates. When the light is later moved, the strength is re-scaled to still pertain to the new target. spread Angle of light spread in the relationship between the vertical position of the light source and the surface of the visual object. 0 to 90 degrees. Low spread (such as low integer values) produces a smaller shaped cone of light. High angle of spread produces an oblique oval or circle of light.
The cone light fades with distance from the target x,y position. It displays a hard edge at the near edge of the cone light's focus and fades gradually as it reaches the cone light's distance threshold.
Light Filter
Adds a point light source, like a light bulb.
call object.filters.Light.addPoint(x,y,z,R,G,B,strength)
Parameter Description object Name of the object to which the Light filter is applied. x, y, z Point light's coordinates. R Red value, integer from 0 to 255. 0 is lowest saturation, 255 is highest. G Green value, integer from 0 to 255. 0 is lowest saturation, 255 is highest. B Blue value, integer from 0 to 255. 0 is lowest saturation, 255 is highest. strength Intensity setting. Integer value.
Intensity on the page is controlled by the angle of light on the surface. Add several for great multipoint gradients.
Light Filter
Changes the light color for any light on the page.
call object.filters.Light.ChangeColor(lightnumber, r,g,b, fAbsolute)
Parameter Description object Name of the object to which the Light filter is applied. lightnumber Identifying number for the light, for use in script. r Red value, integer from 0 to 255. 0 is lowest saturation, 255 is highest. g Green value, integer from 0 to 255. 0 is lowest saturation, 255 is highest. b Blue value, integer from 0 to 255. 0 is lowest saturation, 255 is highest. fAbsolute If this flag is true (nonzero), ChangeColor sets the value to be that new value. If this flag is false (zero), ChangeColor increments or decrements the color value by that amount.
Light Filter
Changes the intensity of the light.
call object.filters.Light.ChangeStrength(lightnumber, strength, fAbsolute)
Parameter Description object Name of the object to which the Light filter is applied. lightnumber Identifying number for the light, for use in script. strength New intensity. fAbsolute If this flag is true (nonzero), ChangeStrength sets the strength value to be the new value. If this flag is false (zero), ChangeStrength increments or decrements the strength value by that amount.
Light Filter
Deletes all lights associated with the specified Lights Filter.
call object.filters.Light.Clear
Parameter Description object Name of the object to which the Light filter is applied.
This will clear all light sources on the object.
Light Filter
Moves the light effect on the page.
call object.filters.Light.MoveLight(lightnumber, x, y, z, fAbsolute)
Parameter Description object Name of the object to which the Light filter is applied. lightnumber Identifying number for the light, for use in script. x, y, z Location to move the light to. fAbsolute Whether the movement is absolute or relative.
For cone lights, this method changes the position of the light's focus, the target x,y values. For point lights, this method changes the source location, the source x,y,z values. This method has no effect for ambient lights.
Light Filter
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.