salut,
cette page (voir ici) a un système de notation simple, joli, et fonctionnel.
Je débute en JS, et j'avoue ne pas bien comprendre le script vu avec firebug.
Merci aux bons samaritains de s'arrêter ici quelques minutes, le sujet me parait intéressant !
HTML
les note.jpg sont les étoiles
Modifié par vjbeng (26 Jun 2008 - 20:30)
cette page (voir ici) a un système de notation simple, joli, et fonctionnel.
Je débute en JS, et j'avoue ne pas bien comprendre le script vu avec firebug.
Merci aux bons samaritains de s'arrêter ici quelques minutes, le sujet me parait intéressant !
HTML
<tbody>
<tr>
<td class="description" style="color: rgb(68, 68, 68);">Note :</td>
<td class="description" align="right" style="color: rgb(68, 68, 68);">3/5 </td>
<td align="right" width="80">
<img height="16" width="16" src="/world/edito/im/note.jpg"/>
<img height="16" width="16" src="/world/edito/im/note.jpg"/>
<img height="16" width="16" src="/world/edito/im/note.jpg"/>
<img height="16" width="16" src="/world/edito/im/noteOff.jpg"/>
<img height="16" width="16" src="/world/edito/im/noteOff.jpg"/>
</td>
</tr>
<form method="post" action="/news/gastronomie/note.html" name="af_news_noteForm" style="margin: 0px; padding: 0px;"/>
<input type="hidden" value="8299" name="b"/>
<input type="hidden" name="n"/>
<script language="JavaScript">
1function af_news_noteShow(o,v) {for (i=1;i<=5;i++) o.parentNode.childNodes[i-1].src='/world/edito/im/note'+(i>v ? 'Off' : '')+'.jpg';o.parentNode.previousSibling.innerHTML=(v==0?'':v+'/5')+' ';}function af_news_noteSave(v) {document.af_news_noteForm.n.value=v;document.af_news_noteForm.submit();}
</script>
<tr>
<td class="description" style="color: rgb(68, 68, 68);">Notez cette news :</td>
<td class="description" style="color: rgb(68, 68, 68);"> </td>
<td align="right" width="80">
<img height="16" width="16" onmouseout="af_news_noteShow(this,0);" onmouseover="af_news_noteShow(this,1);" onclick="af_news_noteSave(1);" style="cursor: pointer;" src="/world/edito/im/noteOff.jpg"/>
<img height="16" width="16" onmouseout="af_news_noteShow(this,0);" onmouseover="af_news_noteShow(this,2);" onclick="af_news_noteSave(2);" style="cursor: pointer;" src="/world/edito/im/noteOff.jpg"/>
<img height="16" width="16" onmouseout="af_news_noteShow(this,0);" onmouseover="af_news_noteShow(this,3);" onclick="af_news_noteSave(3);" style="cursor: pointer;" src="/world/edito/im/noteOff.jpg"/>
<img height="16" width="16" onmouseout="af_news_noteShow(this,0);" onmouseover="af_news_noteShow(this,4);" onclick="af_news_noteSave(4);" style="cursor: pointer;" src="/world/edito/im/noteOff.jpg"/>
<img height="16" width="16" onmouseout="af_news_noteShow(this,0);" onmouseover="af_news_noteShow(this,5);" onclick="af_news_noteSave(5);" style="cursor: pointer;" src="/world/edito/im/noteOff.jpg"/>
</td>
</tr>
</tbody>
les note.jpg sont les étoiles
Modifié par vjbeng (26 Jun 2008 - 20:30)