The Filters Demo Tool: Initialization | WebReference

The Filters Demo Tool: Initialization

The Filters Demo Tool


We trigger the tool initialization by the BODY statement:

<BODY BGCOLOR="#FFFFFF" onload="displayDefaultFilter()">

The event handler displayDefaultFilter() displays the filter currently selected by default:

function displayDefaultFilter() {

We first assign the image:


where startImage is defined in the beginning of the script and assigned the value of sunset.jpg. The second command, changeFilter() is the same command we call when the user selects a new filter, and explained earlier in this column. The last function, updateFilterCode(), is also used for every filter change, and explained earlier.

There are two functions we did not cover yet, enableControlObject() and disableControlObject(). They are needed only for the Alpha filter, where some parameters are not applicable together with some other parameters and we need to disable them and enable them upon the user's selections. These functions are quite simple. They just set the control's disabled parameter on and off:

function disableControlObject(controlName) {
  for (x=0; x 

Notice the two iterations we do to find an object. Again, this is done to accommodate both the hidden and visible controls that have the same name.

Next: The code

Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: September 25, 2000
Revised: September 25, 2000