Bonjour, un petit script d'image suivant le curseur marche s'il n'y a pas d'en-tête !DOCTYPE mais ne marche plus dès que je la mets. Pourquoi ?
________________________________________________________
SCRIPT QUI FONCTIONNE
<html>
<head>
<script>function suivrecurseur(){
document.getElementById('suivre').style.left=event.x - 39 ; document.getElementById('suivre').style.top=event.y + 1 ;
}
</script>
</head>
<body onmousemove="suivrecurseur();">
<img src="bague.gif" id="suivre" style="position:absolute">
</body>
</html>
________________________________________________________
SCRIPT QUI NE FONCTIONNE PLUS AVEC L'EN-TETE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>function suivrecurseur(){
document.getElementById('suivre').style.left=event.x - 39 ; document.getElementById('suivre').style.top=event.y + 1 ;
}
</script>
</head>
<body onmousemove="suivrecurseur();">
<img src="bague.gif" id="suivre" style="position:absolute">
</body>
</html>
________________________________________________________
A l'inverse un script tout fait que je viens de télécharger sur codes-sources ne marche parfaitement que s'il y a cette en-tête.
Donc que dois-je modifier dans mon mini script pour qu'il marche avec-l'en tête ?
Merci pour vos réponses