September 29, 2000 - Modifying Filters on the Fly | WebReference

September 29, 2000 - Modifying Filters on the Fly

Yehuda Shiran September 29, 2000
Modifying Filters on the Fly
Tips: September 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

All filters support the enabled property, by which you can enable and disable them. In addition, each filter supports its own properties and sometimes its own methods. The filter's properties may be set during its definition and can be modified by a script. Let's modify a shadow color from red to tan, inside the script:

In this page we explain the basics of using filters.
Here is the full code of this filter:

<DIV ID="mydiv1" STYLE="width: 40%; filter: progid:DXImageTransform.Microsoft.engrave() 
progid:DXImageTransform.Microsoft.DropShadow(color='red', OffX=3, OffY=2)">
<IMAGE SRC="bicycle.gif"><FONT COLOR="blue">In this tip we explain the basics of 
using filters.</FONT>
</DIV>
<SCRIPT LANGUAGE="JavaScript">
<!--
mydiv1.filters.item(1).enabled = 1;
mydiv1.filters.item("DXImageTransform.Microsoft.engrave").enabled = 0;
mydiv1.filters.item("DXImageTransform.Microsoft.dropshadow").color = "tan";
// -->
</SCRIPT>

Learn more about filters in Column 68, Introduction to Filters in IE 5.5 and Up.