Code:
<script type="text/javascript">
var a = 5;
var v = new Array();
function checkV()
{
for(i=1; i<=a; i++)
{
v[i] = document.getElementById(i).src;
}
}
window.onload = checkV;
function votes(id,typ)
{
if(typ == "over")
{
for(i=1; i<=a; i++)
{
if(i <= id)
{
document.getElementById(i).src = "full.png"
}
else
{
document.getElementById(i).src = "none.png"
}
}
}
else if(typ == "out")
{
for(i=1; i<=a; i++)
{
document.getElementById(i).src = v[i];
}
}
}
</script>
<form method="POST" action="#vote" name="vote">
<input type="image" id="1" src="full.png" name="one" onmouseover="votes(this.id,'over');" onmouseout="votes(this.id,'out');">
<input type="image" id="2" src="half.png" name="two" onmouseover="votes(this.id,'over');" onmouseout="votes(this.id,'out');">
<input type="image" id="3" src="none.png" name="three" onmouseover="votes(this.id,'over');" onmouseout="votes(this.id,'out');">
<input type="image" id="4" src="none.png" name="fore" onmouseover="votes(this.id,'over');" onmouseout="votes(this.id,'out');">
<input type="image" id="5" src="none.png" name="five" onmouseover="votes(this.id,'over');" onmouseout="votes(this.id,'out');">
1.8
</form>
mfg palicora
"Unsauberes Programmieren wird zu einer Kunst! Man könnte es als den Impressionismus der Informatik bezeichnen!"
