Categories:

JavaScript Kit > IE Filters reference > Here

DropShadow Filter

Last updated: May 21st, 2007

The DropShadow filter adds a solid silhouette (aka shadow) to a content, offset in the specified direction. Defined via IE's CSS filter property, here is its basic syntax:

Syntax:

filter :progid:DXImageTransform.Microsoft.dropShadow(attribute1=value1, attribute2=value2, etc);

Example using inline CSS:

<div style="width: 300px; height: 300px; background-color: black; color: white; filter:progid:DXImageTransform.Microsoft.dropShadow(color=gray,offX=5,offY=5, positive=true);">Some DIV</div>

Syntax via scripting:

//To define a new DropShadow filter on an element
object.style.filter ="progid:DXImageTransform.Microsoft.dropShadow(color=#00ff00,offX=5,offY=5)"

//To get/set a property within the DropShadow filter:
object.filters.item("DXImageTransform.Microsoft.dropShadow").Color=#FF0000;

When getting or setting a specific filter's attribute via scripting, you capitalize the attribute to turn it into a property.

Below lists the attributes/properties of the DropShadow filter:

DropShadow Filter attributes (properties)

Attributes/ Properties Description
enabled Sets/ returns whether the filter is enabled or not. Default is true.

Valid values: true/ false

color Read/Write hexadecimal value that determines the color of the shadow to be dropped.

Valid values: All valid hexadecimal colors or color names.

Example:

<img src="test.gif" style="filter:progid:DXImageTransform.Microsoft.dropShadow(color=#C0C0C0, offX=10, offY=8,  positive=true);" />

Demo:

offX, offY The amount of horizontal and vertical offset of the shadow silhouette relative to the original content. Default is 5 for both attributes.

Valid values: Any integer (pixels implied)

positive Sets whether to create the drop shadow from the non transparent pixels of the object. Default is true (non transparent). Read/Write.

Valid values: true/ false (Boolean)


Reference List

[an error occurred while processing this directive]

CopyRight © 1998-2008 JavaScript Kit. NO PART may be reproduced without author's permission.