15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 1 ✦ Generic HTML Element Objects (Chapter 15)<br />

triggers the first effect. Although the onFilterChange event handler works with<br />

most of the same objects in IE4 as IE5, the filter object transition properties are not<br />

reflected in a convenient form. The syntax shown in Listing 15-39 uses the new<br />

ActiveX filter control found in IE5.5 (described in Chapter 30 of the <strong>JavaScript</strong> <strong>Bible</strong>).<br />

Listing 15-39: Using the onFilterChange Event Handler<br />

<br />

<br />

onFilterChange Event Handler<br />

<br />

function init() {<br />

image1.filters[0].apply()<br />

image2.filters[0].apply()<br />

start()<br />

}<br />

function start() {<br />

image1.style.visibility = “hidden”<br />

image1.filters[0].play()<br />

}<br />

function finish() {<br />

// verify that first transition is done (optional)<br />

if (image1.filters[0].status == 0) {<br />

image2.style.visibility = “visible”<br />

image2.filters[0].play()<br />

}<br />

}<br />

<br />

<br />

<br />

onFilterChange Event Handler<br />

<br />

The completion of the first transition (“circle-in”)<br />

triggers the second (“circle-out”).<br />

Play It Again<br />

<br />

<br />

<br />

<br />

<br />

109<br />

elementObject.onFilterChange

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!