Tomatenmark
Gesperrt
Hallo Forum
Ich habe mit Hilfe von Javascript ein Mouseover bei Bewertungssternen, wie bei Youtube, gebastelt, jedoch funktioniert dieses leider nicht gewünscht.
Der optische Effekt mit dem Wechsel der Sterne beim Mouseover funktioniert wunderbar und schnell, jedoch wird bei aktiviertem Javascript der Link nicht bei Klick ausgeführt.
Ist Javascript deaktiviert funktioniert das Klicken wunderbar (nur das mouseover halt nicht - no na )
Habt ihr Ideen für einen Workaround oder hab ich einen Fehler eingebaut ?
Mein HTML Code:
Der JS Code:
Vielen dank im vorraus.
Grüße mark
Ich habe mit Hilfe von Javascript ein Mouseover bei Bewertungssternen, wie bei Youtube, gebastelt, jedoch funktioniert dieses leider nicht gewünscht.
Der optische Effekt mit dem Wechsel der Sterne beim Mouseover funktioniert wunderbar und schnell, jedoch wird bei aktiviertem Javascript der Link nicht bei Klick ausgeführt.
Ist Javascript deaktiviert funktioniert das Klicken wunderbar (nur das mouseover halt nicht - no na )
Habt ihr Ideen für einen Workaround oder hab ich einen Fehler eingebaut ?
Mein HTML Code:
Code:
<div id="gesamt_votes6" onmouseout="display_vote_stars('5', '0', 'gesamt_votes6', '6', '0')"><a href="?open=contest_photo&action=vote&voting=1&e_id=5" onmouseover="display_vote_stars('5
, '1', 'gesamt_votes6', '6')"><img src="design/images/star_inactive_big.jpg" border="0" alt="Votestern" /></a><a href="?open=contest_photo&action=vote&voting=2&e_id=5" onmouseover="display_vote_stars('5
, '2', 'gesamt_votes6', '6')"><img src="design/images/star_inactive_big.jpg" border="0" alt="Votestern" /></a><a href="?open=contest_photo&action=vote&voting=3&e_id=5" onmouseover="display_vote_stars('5
, '3', 'gesamt_votes6', '6')"><img src="design/images/star_inactive_big.jpg" border="0" alt="Votestern" /></a><a href="?open=contest_photo&action=vote&voting=4&e_id=5" onmouseover="display_vote_stars('5
, '4', 'gesamt_votes6', '6')"><img src="design/images/star_inactive_big.jpg" border="0" alt="Votestern" /></a><a href="?open=contest_photo&action=vote&voting=5&e_id=5" onmouseover="display_vote_stars('5
, '5', 'gesamt_votes6', '6')"><img src="design/images/star_inactive_big.jpg" border="0" alt="Votestern" /></a><br />Noch keine Bewertungen</div>
Der JS Code:
Code:
<script type="text/javascript">
<!--
function display_vote_stars(e_id, voted, container, j, dbValue)
{
if(dbValue)
{
content = "<a href=\"?open=contest_photo&action=vote&voting=1&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '1', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=2&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '2', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=3&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '3', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=4&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '4', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=5&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '5', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a>";
}
else if(voted == 1)
{
content = "<a href=\"?open=contest_photo&action=vote&voting=1&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '1', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=2&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '2', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=3&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '3', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=4&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '4', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=5&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '5', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a>";
}
else if(voted == 2)
{
content = "<a href=\"?open=contest_photo&action=vote&voting=1&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '1', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=2&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '2', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=3&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '3', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=4&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '4', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=5&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '5', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a>";
}
else if(voted == 3)
{
content = "<a href=\"?open=contest_photo&action=vote&voting=1&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '1', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=2&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '2', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=3&e_id="+ e_id +"\" onmouseover=\"display_vote_stars('"+ e_id +"', '3', 'gesamt_votes"+ j +"', '"+ j +"')\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" /></a><a href=\"?open=contest_photo&action=vote&voting=4&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '4', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=5&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '5', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a>";
}
else if(voted == 4)
{
content = "<a href=\"?open=contest_photo&action=vote&voting=1&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '1', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=2&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '2', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=3&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '3', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=4&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '4', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=5&e_id="+ e_id +"\"><img src=\"design/images/star_inactive_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '5', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a>";
}
else
{
content = "<a href=\"?open=contest_photo&action=vote&voting=1&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '1', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=2&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '2', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=3&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '3', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=4&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '4', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a><a href=\"?open=contest_photo&action=vote&voting=5&e_id="+ e_id +"\"><img src=\"design/images/star_active_big.jpg\" border=\"0\" alt=\"Votestern\" onmouseover=\"display_vote_stars('"+ e_id +"', '5', 'gesamt_votes"+ j +"', '"+ j +"')\" /></a>";
}
if(dbValue)
{
if(dbValue > 0)
state = dbValue;
else
state = "Noch keine Bewertungen";
}
else
{
switch(voted)
{
case "1": state = 'Sehr Schlecht'; break;
case "2": state = 'Schlecht'; break;
case "3": state = 'Mittelmäßig'; break;
case "4": state = 'Gut'; break;
case "5": state = 'Sehr Gut'; break;
}
}
document.getElementById(container).innerHTML = content +'<br />'+ state;
}
-->
</script>
Vielen dank im vorraus.
Grüße mark