Etape 1 : Ajouter dans le <HEAD> :
<script> <!-- // D'après un script de P. Gehrig and U. Dudli. at www.24fun.com/ // La largeur de l'image. var aniwidth=41 // La hauteur de l'image. var aniheight=41 // La longueur du pas d'avancement (en pixels). var anistep=15 // Le temps de pause entre chaque pas d'avancement (en millisecondes). var anipause=80 ////////////////////////////////// var x_posani=0 var y_posani=0 var screenwidth var screenheight var thisani var xrange function initiate() { if (document.all) { screenwidth=document.body.clientWidth screenheight=document.body.clientHeight-3 xrange=screenwidth-200 y_posani=screenheight-aniheight x_posani=0 document.all.bottom.style.posLeft=x_posani document.all.bottom.style.posTop=y_posani thisani=eval("document.all.left.style") } if (document.layers) { screenwidth=window.innerWidth screenheight=window.innerHeight-3 xrange=screenwidth-200 y_posani=screenheight-aniheight-15 x_posani=0 document.bottom.left=x_posani document.bottom.top=y_posani thisani=eval("document.left") } movebottom() } function movebottom() { if (x_posani<screenwidth-aniheight) { x_posani+=anistep if (document.all) { thisani.posLeft=-2000 thisani=eval("document.all.bottom.style") thisani.posLeft=x_posani thisani.posTop=y_posani } if (document.layers) { thisani.left=-2000 thisani=eval("document.bottom") thisani.left=x_posani thisani.top=y_posani } var timer=setTimeout("movebottom()",anipause) } else { clearTimeout(timer) x_posani-=anistep moveright() } } function moveright() { if (y_posani>0) { y_posani-=anistep if (document.all) { thisani.posLeft=-2000 thisani=eval("document.all.right.style") thisani.posLeft=x_posani thisani.posTop=y_posani } if (document.layers) { thisani.left=-2000 thisani=eval("document.right") thisani.left=x_posani thisani.top=y_posani } var timer=setTimeout("moveright()",anipause) } else { clearTimeout(timer) y_posani+=anistep/2 movetop() } } function movetop() { if (x_posani>0) { x_posani-=anistep if (document.all) { thisani.posLeft=-2000 thisani=eval("document.all.top.style") thisani.posLeft=x_posani thisani.posTop=y_posani } if (document.layers) { thisani.left=-2000 thisani=eval("document.top") thisani.left=x_posani thisani.top=y_posani } var timer=setTimeout("movetop()",anipause) } else { clearTimeout(timer) moveleft() } } function moveleft() { if (y_posani<screenheight-aniheight) { y_posani+=anistep if (document.all) { thisani.posLeft=-2000 thisani=eval("document.all.left.style") thisani.posLeft=x_posani thisani.posTop=y_posani } if (document.layers) { thisani.left=-2000 thisani=eval("document.left") thisani.left=x_posani thisani.top=y_posani } var timer=setTimeout("moveleft()",anipause) } else { clearTimeout(timer) y_posani-=anistep movebottom() } } // --> </script>
Il faut configurer quelques variables au début du script.
Etape 2 : Ajouter dans la balise <BODY> :
<body onLoad="initiate()" style="width:100%;overflow-x:hidden;overflow-y:hidden">
Etape 3 : Ajouter juste après la balise <BODY>:
<DIV id="bottom" style="position:absolute;left:-5000px;"><IMG SRC="moucheb.gif"> </DIV> <DIV id="right" style="position:absolute;left:-5000px;"><IMG SRC="mouched.gif"> </DIV> <DIV id="top" style="position:absolute;left:-5000px;"><IMG SRC="moucheh.gif"> </DIV> <DIV id="left" style="position:absolute;left:-5000px;"><IMG SRC="moucheg.gif"> </DIV>
C'est dnas cette partie que l'on met les images.
Etape 4 : Enregistrer l'images de votre choix