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();
Syntax (post IE8):
-ms-filter: "progid:DXImageTransform.Microsoft.Light()";
Note: See "Difference in syntax between pre IE8 and IE8+ browsers" for more info on the changes to the filter syntax in IE8+.
Example:
<style type="text/css">
#somediv{
width: 90%;
-ms-filter: "progid:DXImageTransform.Microsoft.Light(enabled=false)";
filter: progid:DXImageTransform.Microsoft.Light(enabled=false);
}
</style>
<div id="somediv">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: <style type="text/css"> 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: <style type="text/css"> 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: <style type="text/css"> Demo (IE 5.5+): ![]() My flowers |
changeColor(lightnumber, red, green, blue, absoluteBol) |
Changes the color of the light.
Valid values for the parameters:
Example: <style type="text/css"> Demo (IE 5.5+):
|
changeStrength(lightnumber, strength, absoluteBol) |
Changes the intensity of the light.
Valid values for the parameters:
Example: <style type="text/css"> Demo (IE 5.5+):
|
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: <style type="text/css"> Demo (IE 5.5+):
|