Availability: |
| |||
Object properties: | Duration, Enabled, MaxSquare, Percent, status | |||
Object methods: | apply(), play(), stop() |
This transition effect supports the following properties:
The Duration property controls the time it takes to play back the transition effect.
The Enabled property provides a way to activate or inhibit the filter from working by assigning the true or false value to it.
The MaxSquare property indicates the largest possible size of a pixelated square. This can be in the range 2 to 50.
The Percent property controls the point at which the effect can be halted to provide a static effect. The value can be between 0 and 100.
The status property value can be read to determine the current disposition of the transition filter. It will return one of three values. The 0 value indicates the transition has stopped, 1 indicates that it is completed and 2 that it is still in progress.
The following methods are supported by this transition filter:
The apply() method sets the transition effect to its initial condition.
The play() method executes the transition effect using the control values and taking the time specified in the duration value. You can override the duration property by passing an optional duration argument to this method when it is called.
The stop() method can be called at any time during the time the transition is running to halt the transition playback. This will also trigger the execution of an onFilterChange event handler if there is one defined.
The example demonstrates a gross pixelation transition effect.
<HTML> <HEAD> </HEAD> <BODY onLoad="switchState()"> <DIV ID="CONTAINER" STYLE="position:absolute; top: 0; left: 0; width: 300; height:300; filter:progid:DXImageTransform.Microsoft.Pixelate(duration=2, maxsquare=50) "> <DIV ID="DIV1" STYLE="position:absolute; top:50; left:10; width:240; height:180;background:ivory"> <BR> <BR> <BR> <HR> <CENTER> This is a DIV block containing text. </CENTER> <HR> </DIV> <DIV ID="DIV2" STYLE="visibility:hidden; position:absolute; top:50; left:10; width:240; height:180; background:antiquewhite; "> <CENTER> <BR> <IMG SRC="./Logo150.gif"> </CENTER> </DIV> </DIV> <SCRIPT> DIV1.style.visibility="visible"; function switchState() { CONTAINER.filters[0].Apply(); if (DIV1.style.visibility == "visible") { DIV1.style.visibility="hidden"; DIV2.style.visibility="visible"; } else { DIV1.style.visibility="visible"; DIV2.style.visibility="hidden"; } CONTAINER.filters[0].Play(); setTimeout("switchState()", 5000); } </SCRIPT> </BODY> </HTML>
See also: | Filter object, style.filter |
Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
Duration | ![]() | 5.5 ![]() | ![]() | 5.5 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Enabled | ![]() | 5.5 ![]() | ![]() | 5.5 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
MaxSquare | ![]() | 5.5 ![]() | ![]() | 5.5 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Percent | ![]() | 5.5 ![]() | ![]() | 5.5 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
status | ![]() | 5.5 ![]() | ![]() | 5.5 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Prev | Home | Next |
filter - MotionBlur() | Up | filter - Pixelate() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |