filter Attribute | filter Property
Sets or retrieves the filter or collection of filters applied to the object.
Syntax
HTML { filter: sFilter } Scripting object.style.filter [ = sFilter ]
Possible Values
sFilter String that specifies one of the following values:
filtertype1 (parameter1, parameter2,...) Any of the filters listed in the Visual Filters and Transitions Reference. filtertype2 (parameter1, parameter2,...) Any of the filters listed in the Visual Filters and Transitions Reference. The property is read/write with no default value; the proposed cascading style sheets (CSS) extension attribute is not inherited.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see dynamic properties.
Remarks
When using a SPAN or DIV object, be sure to specify at least one of the three required CSS attributes: height, width, or position (absolute or relative).
The shadow filter can be applied to the IMG object by setting the filter on the image's parent container.
For more information about filters, see creating multimedia effects with visual filters and transitions. The filter mechanism is extensible and allows you to develop and add additional filters later.
Not available on the Macintosh platform.
Example
The following examples use the filter attribute and the filter property to apply filters.
This example uses an inline style sheet to set the filter on an image.
<IMG STYLE="filter:blur(strength=50) flipv()" SRC="cone.jpg">This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.This example uses inline scripting to set the filter on an image.
Sample Code
<SCRIPT> function doFilter () { filterFrom.filters.item(0).Apply(); // 12 is the dissolve filter. filterFrom.filters.item(0).Transition=12; imageFrom.style.visibility = "hidden"; filterTo.style.visibility = ""; filterFrom.filters.item(0).play(14); } </SCRIPT> </HEAD> <BODY> Click on the image to start the filter.<BR> // Call the function. <DIV ID="filterFrom" onClick="doFilter()" STYLE="position:absolute; width:200; height:250; background-color:white; filter:revealTrans()"> <IMG ID="imageFrom" STYLE="position:absolute; top:20; left:20;" SRC="sphere.jpg"> <DIV ID="filterTo" STYLE="position:absolute; width:200; height:250; top:20; left:20; background:white; visibility:hidden;"> </DIV> </DIV>
Applies To
[ Object Name ] Platform Version Win16: Win32: Mac: Unix: WinCE: Version data is listed when the mouse hovers over a link, or the link has focus. BODY, BUTTON, custom, DIV, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, MARQUEE, runtimeStyle, SPAN, style, TABLE, TD, TEXTAREA, TH
Did you find this topic useful? Suggestions for other topics? write us!
© 1999 microsoft corporation. all rights reserved. terms of use.