Internet Explorer Image Transition Effects

Internet Explorer supports its own custom transition effects. These can be used when changing the source of an image, for example on mouse over.

An image on an html page, is represented by the HTML code

<img id=”imgFruit” src=”/images/apples.jpg”>

To change this using JavaScript the src parameter is re-assigned to a different iamge reference:

document.getElementById(“imgFruit”).src=’/images/bananas.jpg’;

The Internet Explorer transitions can be a simple fade between the two images or effects such as swipes and blinds.

JavaScript is used to set the relevant parameters and to trigger the effect.

The example below shows the image tag with its onmouseover and onmouseout actions.

<img src="/images/fruit.png"
onmouseover="replaceImage(this,'fruitO.png');"
onmouseout="imageTrans(this,'fruit.png');">
//
// JavaScript function to enact transition effects
// dependant upon browser type
//
function imageTrans(item,newImage) {
// Get browser name
var browserName=navigator.appName;
// If the browser is Internet Explorer do transition effect
if (browserName=="Microsoft Internet Explorer") {
item.style.filter="blendTrans(duration=5)";
item.style.filter="blendTrans(duration=20)";
item.filters.blendTrans.Apply();
item.filters.blendTrans.Play();
}
// Replace the image
if (document.getElementById){
item.src=newImage;
}
}

The table below shows the Internet Explorer effects and their codes.

EffectMSIE Transition #MSIE Effect
None0Box in
Box in0Box in
Box out1Box out
No PPT equiv.2Circle in
No PPT equiv.3Circle out
Wipe up4Wipe up
Wipe down5Wipe down
Wipe right6Wipe right
Wipe left7Wipe left
Vertical blindss8Vertical blinds
Horizontal blinds9Horizontal blinds
Checkerboard across10Checkerboard across
Checkerboard down11Checkerboard down
 Random dissolve12Random dissolve
Split vertical in13Split vertical in
Split vertical out14Split vertical out
Split horizontal in15Split horizontal in
Split horizontal out16Split horizontal out
Strips left down17Strips left down
Strips left up18Strips left up
Strips right down19Strips right down
Strips right up20Strips right up
Random bars horizontal21Random bars horizontal
Random bars vertical22Random bars vertical
Random23Random