Etape 1 : Ajouter entre les balises <HEAD>...</HEAD>:
<script> <!-- dynamicanimAttr = "mydynamicanimation" animateElements = new Array() currentElement = 0 speed = 0 stepsZoom = 8 stepsWord = 8 stepsFly = 12 stepsSpiral = 25 steps = stepsZoom step = 0 outString = "" function mydynAnimation() { var ms = navigator.appVersion.indexOf("MSIE") ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4) if(!ie4) { if((navigator.appName == "Netscape") && (parseInt(navigator.appVersion.substring(0, 1)) >= 4)) { for (index=document.layers.length-1; index >= 0; index--) { layer=document.layers[index] if (layer.left==10000) layer.left=0 } } return } for (index=document.all.length-1; index >= document.body.sourceIndex; index--){ el = document.all[index] animation = el.getAttribute(dynamicanimAttr, false) } i = 0 for (index=document.body.sourceIndex; index < document.all.length; index++){ el = document.all[index] animation = el.getAttribute(dynamicanimAttr, false) if (null != animation){ if(animation == "spiral"){ el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth el.style.posTop = document.body.scrollTop-offsetTop(el)-el.offsetHeight } el.initLeft = el.style.posLeft el.initTop = el.style.posTop animateElements[i++] = el } } window.setTimeout("animate();", speed) } function offsetLeft(el){ x = el.offsetLeft for (e = el.offsetParent; e; e = e.offsetParent) x += e.offsetLeft; return x } function offsetTop(el){ y = el.offsetTop for (e = el.offsetParent; e; e = e.offsetParent) y += e.offsetTop; return y } function animate(){ el = animateElements[currentElement] animation = el.getAttribute(dynamicanimAttr, false) step++ if(animation == "spiral"){ steps = stepsSpiral v = step/steps rf = 1.0 - v t = v * 2.0*Math.PI rx = Math.max(Math.abs(el.initLeft), 300) ry = Math.max(Math.abs(el.initTop), 300) el.style.posLeft = Math.ceil(-rf*Math.cos(t)*rx) el.style.posTop = Math.ceil(-rf*Math.sin(t)*ry) } if (step >= steps){ el.style.posLeft = 0 el.style.posTop = 0 currentElement++ step = 0 } if(currentElement < animateElements.length) window.setTimeout("animate();", speed) } //--> </script>
Etape 2 : Ajouter dans le body pour réaliser l'effet.
Il faut modifier l'adresse de l'image ainsi que ses attributs width et height.
<center><span mydynamicanimation="spiral" style="position: relative !important; left: 10000 !important"> <img src="votre_image-2.html" height=xx width=yy></span></center>
Etape 3 : Ajouter dans la balise body elle-même.
<body onload="mydynAnimation()">