Cullmann87
Grünschnabel
Wie im Titel beschrieben, hab hier ein Script versucht, dass eine Sternebewertung ermöglichen soll, im IE funktioniert es soweit auch, im Firefox und Opera allerdings nicht, vielleicht könnt ihr mir ja helfen:
<meta http-equiv="content-script-type" content="text/javascript">
<script language="javascript" type="text/javascript">
<!--
function EnterStarButton(idPrefix, num, numTotal)
{
for (c=0; c<numTotal; c++)
{
if (c <= num)
document.getElementById(idPrefix+c).className="starButton starButtonOn";
else
document.getElementById(idPrefix+c).className="starButton starButtonOff";
}
}
function LeaveStarButton(idPrefix, num, numTotal)
{
var value = document.getElementById(idPrefix+'value').value - 1;
for (c=0; c<numTotal; c++)
{
if (c <= value)
document.getElementById(idPrefix+c).className="starButton starButtonOn";
else
document.getElementById(idPrefix+c).className="starButton starButtonOff";
}
}
function ClickStarButton(idPrefix, num, numTotal)
{
document.getElementById(idPrefix+'value').value = (num+1);
}
-->
</script>
<div class="starContainer">
<span id="star.0.0" class="starButton starButtonOn" onmouseenter="EnterStarButton('star.0.', 0, 5)" onmouseleave="LeaveStarButton('star.0.', 0, 5)" onClick="ClickStarButton('star.0.', 0, 5)"></span>
<span id="star.0.1" class="starButton starButtonOn" onmouseenter="EnterStarButton('star.0.', 1, 5)" onmouseleave="LeaveStarButton('star.0.', 1, 5)" onClick="ClickStarButton('star.0.', 1, 5)"></span>
<span id="star.0.2" class="starButton starButtonOn" onmouseenter="EnterStarButton('star.0.', 2, 5)" onmouseleave="LeaveStarButton('star.0.', 2, 5)" onClick="ClickStarButton('star.0.', 2, 5)"></span>
<span id="star.0.3" class="starButton starButtonOff" onmouseenter="EnterStarButton('star.0.', 3, 5)" onmouseleave="LeaveStarButton('star.0.', 3, 5)" onClick="ClickStarButton('star.0.', 3, 5)"></span>
<span id="star.0.4" class="starButton starButtonOff" onmouseenter="EnterStarButton('star.0.', 4, 5)" onmouseleave="LeaveStarButton('star.0.', 4, 5)" onClick="ClickStarButton('star.0.', 4, 5)"></span>
</div>
<meta http-equiv="content-script-type" content="text/javascript">
<script language="javascript" type="text/javascript">
<!--
function EnterStarButton(idPrefix, num, numTotal)
{
for (c=0; c<numTotal; c++)
{
if (c <= num)
document.getElementById(idPrefix+c).className="starButton starButtonOn";
else
document.getElementById(idPrefix+c).className="starButton starButtonOff";
}
}
function LeaveStarButton(idPrefix, num, numTotal)
{
var value = document.getElementById(idPrefix+'value').value - 1;
for (c=0; c<numTotal; c++)
{
if (c <= value)
document.getElementById(idPrefix+c).className="starButton starButtonOn";
else
document.getElementById(idPrefix+c).className="starButton starButtonOff";
}
}
function ClickStarButton(idPrefix, num, numTotal)
{
document.getElementById(idPrefix+'value').value = (num+1);
}
-->
</script>
<div class="starContainer">
<span id="star.0.0" class="starButton starButtonOn" onmouseenter="EnterStarButton('star.0.', 0, 5)" onmouseleave="LeaveStarButton('star.0.', 0, 5)" onClick="ClickStarButton('star.0.', 0, 5)"></span>
<span id="star.0.1" class="starButton starButtonOn" onmouseenter="EnterStarButton('star.0.', 1, 5)" onmouseleave="LeaveStarButton('star.0.', 1, 5)" onClick="ClickStarButton('star.0.', 1, 5)"></span>
<span id="star.0.2" class="starButton starButtonOn" onmouseenter="EnterStarButton('star.0.', 2, 5)" onmouseleave="LeaveStarButton('star.0.', 2, 5)" onClick="ClickStarButton('star.0.', 2, 5)"></span>
<span id="star.0.3" class="starButton starButtonOff" onmouseenter="EnterStarButton('star.0.', 3, 5)" onmouseleave="LeaveStarButton('star.0.', 3, 5)" onClick="ClickStarButton('star.0.', 3, 5)"></span>
<span id="star.0.4" class="starButton starButtonOff" onmouseenter="EnterStarButton('star.0.', 4, 5)" onmouseleave="LeaveStarButton('star.0.', 4, 5)" onClick="ClickStarButton('star.0.', 4, 5)"></span>
</div>