else
toggle = 1
mydiv.style.backgroundColor=”lime”
end if
Finally, after the background color has been changed, the playmethod is
triggered and the transition fades as you requested:
mydiv.filters(0).Play
Playis a function that’s built into the IE browser, so you don’t have to write
this function. You can just name it. Same with the applyfunction.
For tricks on debugging script (fixing things that don’t work right because
you didn’t do the programming correctly), see Chapter 17.
If you want to use this script with a different kind of transition, just make a
simple change to the name of the filter and perhaps tweak the attributes. To
see the blindstransition (it looks like Venetian blinds), all you have to
change is the name of the filter in the code, like this:
filter:progid:DXImageTransform.Microsoft.Blinds(duration=3)
Make this change, and then load the file into Internet Explorer and click the
button. You see the result shown in Figure 13-5:
Figure 13-5:
The
blinds
transition
effect
looks as if
someone is
opening
Venetian
blinds.