JavaScript Kit > IE Filters reference > Here
Light Filter
The Light filter adds the effect of a light shining on a content. You manipulate the shape and strength of the light using JavaScript and via the Light's exposed methods.
Syntax:
filter :progid:DXImageTransform.Microsoft.Light();
Example using inline CSS:
<div style="width: 90%; filter:progid:DXImageTransform.Microsoft.Light(enabled=false);">Some DIV</div>
Syntax via scripting:
//To define a new Light filter on
an element
object.style.filter ="progid:DXImageTransform.Microsoft.Light(attribute=value1,
attribute2=value2)"
To access an existing property within the Light filter:
object.filters.item("DXImageTransform.Microsoft.Light").Property1=value1;
//To access an existing property within the Light filter via the
filters[] object
object.filters[x].Property1=value1 //where "x" is
the position of the filter within list of filters on element. There are no attributes/properties for the Light filter:
Light Filter attributes (properties)
| Attributes/ Properties | Description |
|---|---|
| enabled | Sets/ returns whether the filter is enabled or not.
Default is true.Valid values: true/ false |
Light Filter methods (accessible only via scripting)
| Methods | Description |
|---|---|
| addAmbient(red, blue, green, strength) | This methods adds a
nondirectional, ambient light to the object. It is often used in
combination with other lights. Valid values for the parameters:
Example: <img id="plants" src="flower.gif"
style="filter:progid:DXImageTransform.Microsoft.Light();" /> Demo:
|
| addCone(X1, Y1, Z1, X2, Y2, red, green, blue, strength, spread) | Adds a cone shaped, directional light to the object.
Valid values for the parameters:
Example: <div id="mydiv" style="width: 150px; height:
100px; background-color: gray; filter
:progid:DXImageTransform.Microsoft.Light();"> Demo: ![]() My dog |
| addPoint(X, Y, Z, red, green, blue, strength) | Adds a light that originates at a single point and
radiates in all directions. Valid values for the parameters:
Example: <div id="mydiv2" style="width: 150px; height:
100px; background-color: gray; filter
:progid:DXImageTransform.Microsoft.Light();"> Demo: ![]() My flowers |
| changeColor(lightnumber, red, green, blue, absoluteBol) | Changes the color of the light. Valid values for the parameters:
Example: <img id="mypet" src="test.gif" style="filter
:progid:DXImageTransform.Microsoft.Light();" /> |
| changeStrength(lightnumber, strength, absoluteBol) | Changes the intensity of the light. Valid values for the parameters:
Example: <img id="mypet" src="test.gif" style="filter
:progid:DXImageTransform.Microsoft.Light();" /> |
| clear() | Simply deletes all lights from the object. |
| moveLight(lightnumber, X, Y, Z, absoluteBol) | For cone lights, moves the focus, or for point
lights, the origin, of the light. Valid values for the parameters:
Example: <img id="myimg" style="position: relative;
width: 174px; height: 146px; filter
:progid:DXImageTransform.Microsoft.Light();" src="flower.gif" /> Demo:
|
