filter Attribute | filter Property

MS Office DHTML, HTML & CSS

filter Attribute | filter Property


Sets or retrieves the filter or collection of filters applied to the object.

Syntax

HTML{ filter: sFilter }
Scriptingobject.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 propertiesInternet Link.

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 transitionsInternet Link. 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.
Microsoft Internet Explorer

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> 
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.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
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

Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.