Click the image to change the picture


In this version of the page you can click on the image as often as you like, and you won't get a script error from trying to kick off a transtion while an earlier one's still in progress.

This is because the function which sets the transition running checks that the status of the transition filter for the image object (i.e. thisObj.filters.revealTrans.status) is zero (not running) before initiating the transition. The other possible values of the .status property are 1 (applied but not yet running) and 2 (running). When the transition is complete, the filter's status property is automatically reset to zero.

So how about the 'Nice Transtion' message which appears whenever a transition finishes, and stays on screen for a couple fo seconds?

Not surprisingly, the text is held win a DIV, with its .style.visibility property initially set to 'hidden' - that's a standard way to place concealed comments and error messages in an IE 4 page.

The IMG object's HTML tag has an extra event-handler, onFilterChange="showmessage(). This event occurs whenever a transition filter completes its action. The function showmessage() sets the DIV's .style.visibility property to 'visible', then calls the setTimeout() method to set a timer delay, telling the browser to set the DIV's .style.visibility property to 'hidden' after 2.5 seconds.

Back to Menu