Bonjour, voila je voudrais utiliser deux script sur une meme page, mais quand je les met tout les deux sur ma page seul le dernier (dans le fil du code) est afficher.
Voici le premier a afficher :
<DIV ID=pub STYLE="position:absolute;top:0;left:0;z-index:10"></DIV>
<SCRIPT LANGUAGE=JavaScript>
/* LAISSER CES LIGNES */
function showsup()
{
if(document.getElementById)
{
document.getElementById("pub").style.width = larg;
document.getElementById("pub").style.height = haut;
document.getElementById("pub").innerHTML = html_haut+html_mil+html_bas;
setTimeout("closeSup()",20000);
}
}
function closeSup()
{
if(document.getElementById)
{
document.getElementById("pub").style.width = 1;
document.getElementById("pub").style.height = 1;
document.getElementById("pub").innerHTML = '';
}
}
if(document.all)
{
larg = document.body.clientWidth;
haut = document.body.clientHeight;
}
else
{
larg = screen.width;
haut = screen.height;
}
html_haut = "<TABLE WIDTH="+larg+" HEIGHT="+haut+"><TR><TD VALIGN=middle ALIGN=center BACKGROUND=image/grille.gif>";
html_bas = "</TD></TR></TABLE>";
/*
A VOUS DE MODIFER CES LIGNES
N'OUBLIEZ UN LIEN DE CE TYPE :
<A HREF=# onClick="closeSup();return(false)">texte ou image</A>
POUR POUVOIR REFERMER LA FENETRE SI LE VISITEUR N'EST PAS INTERESSE
*/
html_mil = "<TABLE WIDTH=600 CELLPADDING=0 CELLSPACING=0 BORDER=0>";
html_mil += " <TR>";
html_mil += "<TD><A HREF=HREF=# onClick=\"closeSup();return(false)\"><IMG SRC=image/nain.gif BORDER=0 WIDTH=600 HEIGHT=463 HSPACE=0 VSPACE=0></A></TD>";
html_mil += "</TR>";
html_mil += "</TABLE>";
window.onload = showsup;
</SCRIPT>
Et le deuxieme :
<!-- DEBUT DU SCRIPT -->
<script type="text/javascript">
var x = 0;
var y = 0;
if (document.getElementById)
{
if(navigator.appName.substring(0,3) == "Net")
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = Pos_Souris;
window.onload = Bouge_Image;
}
function Pos_Souris(e)
{
x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.body.scrollLeft;
y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y+document.body.scrollTop;
}
posX = 0;
posY = 0;
anim = true;
oldpos = "
[ Lien ]";
function Bouge_Image()
{
if (document.getElementById && anim)
{
posX = posX+(((x-posX)+20)/15);
posY = posY+(((y-posY)+20)/15);
document.getElementById("teteronde").style.top = posY;
document.getElementById("teteronde").style.left = posX;
tempo = setTimeout("Bouge_Image()", 15)
}
}
if(document.getElementById)
{
document.write('<DIV ID=teteronde style="position: absolute">');
document.write('<A HREF="#" onClick="anim=false;document.getElementById(\'teteronde\').style.visibility = \'hidden\';return(false)">');
document.write('<IMG SRC="
[ Lien ]" BORDER=0 HSPACE=0 VSPACE=0 NAME=tete ALT="Cliquez ici pour faire disparaître">');
document.write('</A>');
document.write('</DIV>');
}
</SCRIPT>
<!-- FIN DU SCRIPT -->
A oui je vais essayer de mofier le deuxieme pour afficher une image differente suivant la direction de la souris (haut, bas , droite , gauche)