Astuces du SpeeDEricH.com

Merci pour ce ....... SPEED EXEMPLE JAVA SCRIPT 48

UN TEXTE animé à coté DU CURSEUR

Deux petites opérations à réaliser cette fois pour parvenir à cet effet :
Tu recopies dans ta partie BODY :
<SCRIPT LANGUAGE="JavaScript"><!--
var DeltaX=20 // éloignement horizontal du texte par rapport au curseur de la souris
var DeltaY=-10 // éloignement vertical du texte par rapport au curseur de la souris
function init02(){
stallone("<FONT COLOR='#0000FF' face=Arial // police+ couleur size=2><B>texte 1</B></FONT>",1000)
// texte 1 + temps de transition
stallone("<FONT COLOR='#FF0000' face=Arial size=2><B>texte 2</B></FONT>",1000) 
// texte 2 + temps de transition
stallone("<FONT COLOR='#0000FF' face=Arial size=2><B>texte 3</B></FONT>",1000)
// texte 3 + temps de transition
stallone("<FONT COLOR='#FF0000' face=Arial size=2><B>texte 4</B></FONT>",1000)
// texte 4 + temps de transition
brucewillis();}
var z=0;var i=0;var t;var rz=0
texte= new Array()
speed= new Array()
function stallone(txt,delai){
texte[z]=txt;speed[z]=delai;z++;}
if (navigator.appName == "Netscape") {
document.captureEvents(Event.MOUSEMOVE);
document.write('<LAYER NAME="mgdh" top=-100></LAYER>');t=1;}else{
document.write('<span ID="mgdh" STYLE="Position:relative; top:-100;"></span>');t=0;}
function brucewillis(){
if (t) {document.mgdh.document.write(texte[i]);document.close();}
else document.all.mgdh.innerHTML=texte[i];i++;
if (i>=z) i=0;setTimeout("brucewillis()",speed[i]);}
function detect02(ev){
if (t){ with(document.mgdh){left=ev.pageX+DeltaX; top=ev.pageY+DeltaY};}
else { with(document.all.mgdh.style){left=event.clientX+DeltaX;
top=event.clientY+DeltaY};};}
document.onmousemove=detect02
//--></SCRIPT>
Tu ajoutes ensuite ce code dans ta balise <BODY> :
onload="init02()"

RETOUR à l'exemple précédent  : Un texte qui suit le curseur SOMMAIRE des Exemples JAVA SCRIPT SUITE des exemples : Liens animés multicolores

ED   05-03-2003
SpeeDEricH.com Nedstat Tu mesures ton audience ?