Note, on peut dire que c'est
function Note(n)
{
alert(n);
}
Mais voici tout de meme les lignes de code
function window_onload()
{
Note();
for(var i=0; i < 11; i++)
{
document.getElementById("Note").getElementsByTagName("img")[i].onmouseover
= function(){Note(i);};
// Ne fonctionne pas non plus
//
with(document.getElementById("Note").getElementsByTagName("img")[i])
// {
//
if(document.attachEvent)// IE 5+
// {
//
attachEvent("onmouseover",function(){Note(i);});
//
attachEvent("onmouseout",function(){Note();});
// }
// else if
(document.addEventListener)// DOM 2, NS6+
// {
//
addEventListener("mouseover",function(){Note(i);},true);
//
addEventListener("mouseout",function(){Note();},true);
// }
// }
}
}
Pour ce qui est du HTML :
<body onload="javascript:window_onload()">
<div id="Note">
Notes<br />
<img src="Images/star.gif" alt="0/10" /><img
src="Images/star.gif" alt="1/10" /><img
src="Images/star.gif" alt="2/10" /><img
src="Images/star.gif" alt="3/10" /><img
src="Images/star.gif" alt="4/10" /><img
src="Images/star.gif" alt="5/10" /><img
src="Images/star.gif" alt="6/10" /><img
src="Images/star.gif" alt="7/10" /><img
src="Images/star.gif" alt="8/10" /><img
src="Images/star.gif" alt="9/10" /><img
src="Images/star.gif" alt="10/10" />
</div>
</body>
Si je met un onmouseover et onmouseout sur chaque img ca fonctionne,
mais je veux quelque chose d'optimisé, il en va pour le bien de tous
Si je fais un onmouseover sur une image, ca m'affiche 11, si je fais un onmouseout, ca m'affiche bien null
mon problème se situe au niveau du 11, j'aurais preferé le bon numéro

Cyril - http://Hoshimi.CodeS-SourceS.fr