Bonjour,
Je ne connais pas grand chose en Javascript, néanmoins je souhaite ajouté a mon site quelques fonctions que j'ai déjà repérés ici.
Le problème, c'est que je souhaite combiner deux codes : explications :
Voici un code qui permet , lorsqu'on survole de la souris le mot "entrer" d'ouvrir une petite fenêtre avec un message.
html>
<HEAD><br><br>
<p><center><font color='red' size=+1>Entrer sur le site en passant l'introduction</font>
<b onMouseOver="alert(' Vous allez être redirigé automatiquement vers le site , bonne visite!')">
<font size=+1> Entrer </font></center>
</b>
</p>
</head>
<BODY onLoad="init02()">
<SCRIPT LANGUAGE="JavaScript">
var DeltaX=15 //Distance horizontale du curseur
var DeltaY=5 //Distance verticale du curseur
function init02()
{
ajout("<font color='blue' size=+1><b>C'est</b></font> <font color='red' size=+1<b>plus</b> <b>sympathique</b></font>",900)
ajout("<font color='black' size=+1><b>d'avoir</b></font> <font color='purple' size=+1><b>un</b> <b>peu</b></font>",1600)
ajout("<font color='green' size=+1><b>de lecture</b></font> <font color='blue' size=+1><b>lorsque l'on</b></font>",900)
ajout("<font color='blue' size=+1><b>suis</b><b> des</b></font> <font color='red' size=+1><b>yeux</b></font>",900)
ajout("<font color='red' size=+1<b>ce</b> <b>foutu</b></font> <font color='green' size=+1<b>pointeur</b> <b>;-)</b></font>",900)
letsgo();
}
var z=0;
var i=0;
var t;
var rz=0
texte= new Array()
speed= new Array()
function ajout(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 letsgo()
{
if (t)
{
document.mgdh.document.write(texte[i]);
document.close();
}
else document.all.mgdh.innerHTML=texte[i];
i++;
if (i>=z) i=0;
setTimeout("letsgo()",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.body.scrollTop
};
};
}
document.onmousemove=detect02
</script>
</BODY>
</HTML>
Je souhaite combiner à ce code un autre code qui ferait un compte à rebours puis une redirection
dans la fenêtre du message ouverte par l'autre code :
<html>
<head>
<title>Redirection</title>
</head>
<body topmargin="0">
<SCRIPT LANGUAGE="JavaScript">
window.setTimeout("document.form.time.value='5'",1000)
window.setTimeout("document.form.time.value='4'",2000)
window.setTimeout("document.form.time.value='3'",3000)
window.setTimeout("document.form.time.value='2'",4000)
window.setTimeout("document.form.time.value='1'",5000)
window.setTimeout("document.form.time.value='0';location=('http://www.ulimitedforces.ilogames.net/nk');",6000)
</script>
<center><FORM METHOD=POST name="form">
<INPUT TYPE="text" NAME="time" size="1" style="border: 0; background-color: #003060; font-size: 8pt; background-repeat: repeat; background-attachment: scroll; font-weight: bold; font-family: tahoma, Arial, Helvetica, sans-serif; color: #90A8E8; background-position: 0% 50%"> secondes avant accès au site.
</FORM> </center>
</body>
</html>
Pouvez vous s'il vous plait m'indiquez comment faire?