Availability: |
| |||
JavaScript syntax: | IE | myFilter = myElement.filters(anIndex) | ||
IE | myFilter = myElement.filters[anIndex] | |||
IE | myFilter = myFilters[anIndex] | |||
Argument list: | anIndex | A reference to an element in a collection | ||
Object properties: | enabled |
This object defines a visual effect that is used when the display is updated as the result of a change to the content of an element. The Filter object has properties that relate to the individual filters. There are some common properties (and methods) that are available to all filters and in some cases the same property name can mean different things depending on the filter being applied.
You should access the filter objects via the Filters collection because you may have the same filter type repeated for a cascading effect and so you need to be sure that you are addressing the right one.
There are three kinds of filters that can be applied to an object.
Visual
Reveal
Blend
A visual filter is used to enhance the visual appearance of objects. Maybe to flip them over, add a glow effect or a drop shadow.
A reveal filter is used to apply a transition effect as the appearance changes.
A blend filter controls the speed at which a reveal filter is applied.
You can define more than one filter, they just need to be space separated from one another.
Here is a list of the procedural filter function names:
AlphaImageLoader()
Gradient()
Here is a list of the static filters supported at version 5.5 of the MSIE browser:
Alpha()
BasicImage()
Blur()
Chroma()
Compositor()
DropShadow()
Emboss()
Engrave()
Glow()
Light()
MaskFilter()
Matrix()
MotionBlur()
Pixelate()
Shadow()
Wave()
The old blendTrans() and revealTrans() filters are now replaced by these transition filters:
Barn()
Blinds()
CheckerBoard()
Fade()
GradientWipe()
Inset()
Iris()
Pixelate()
RadialWipe()
RandomBars()
RandomDissolve()
Slide()
Spiral()
Stretch()
Strips()
Wheel()
Zigzag()
Filters are defined as if they were a sequence of space delimited function calls. they aren't really functions because their argument passing mechanism is not truly JavaScript based. Arguments to each filter function are defined as name=value pairs.
Refer to the specific topics on each filter function for details of what it does and how you can control it.
When using the filters in the context of the style object, the function name for each filter must be preceded by this string (although some less sophisticated filters seem to work without this):
"progid:DXImageTransform.Microsoft."
You can apply the filters directly as properties of the filter object that belongs to HTML element objects themselves.
Thus:
myFilter.Shadow(someAttributes)
Filters are not supported in all versions of MSIE on the Macintosh. In fact they are not really well supported outside of the MSIE browser or the Win32 platform.
There are various sources of documentation about these filters. There is some difference between them regarding the spelling of the filters names and the availability of the filters. The naming conventions are sometimes all lower case and at others a mixed upper and lower case. This suggests that the filter name parser may be case-insensitive. This also applies to the name=value pairs that are passed as arguments to the filter functions.
Certain filter functions are no longer included in the MSDN reference material and so they may be considered to be deprecated.
We have conformed to the case style of the MSDN reference and have included all the filters that were covered in earlier references as well as those that have been added recently. Those that appear not to be in the MSDN reference anymore are marked as deprecated as follows:
FlipH()
FlipV()
Grayscale()
Invert()
Mask()
XRay()
These are deprecated filters that used to provide blends and reveals:
BlendTrans()
RevealTrans()
Note that the functionality and availability of the filters has changed significantly from version 4.0 to version 5.5 of the MSIE browser and the older deprecated filters have been assimilated into the functionality of the new filter set. No previously existing filter appearance has been lost but they do need to be operated differently.
Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
enabled | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Prev | Home | Next |
filter - Zigzag() | Up | Filter.enabled |
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. |