on mouse over javascript in tabelle body bg


Programmierung HTML, CSS, PHP, JAVA, XML etc.

Antwort
 
Themen-Optionen
Alt 26.11.2007, 17:32   #1 (permalink)
on mouse over javascript in tabelle body bg

Hi liebe Programmierergemeinde

Meine Freundin hat ein kleines Problem. Sie hat in der Uni folgende Aufgabe bekommen:

1. Legen Sie ein XHTML-Dokument mit einer Tabelle (eine Zeile, drei Spalten) an. Weisen sie jeder Tabellenzelle eine bestimmte Breite, eine Hintergrundfarbe und einen Event-Handler zu, der beim Mouse-Over den Seitenhintergund in die gewählte Farbe verändert:

like this:
http://hki.uni-koeln.de/?q=dogsbody_...course/8/33/11

ihr quelltext lautet:

Zitat:
<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HKI Proseminar: JavaScript</title>
</head>
<body>
<script type="text/javascript">
function hintergrund(bkgcolor) {
document.bgcolor=bkgcolor
}

</script>

<table border="1">
<tr>
<td style="background-color:red" width="50pt" height="50" onmouseover="hintergrund('red')"></td>
<td style="background-color:yellow" width="50pt" height="50" onmouseover=""></td>
<td style="background-color:blue" width="50pt" height="50" onmouseover=""></td>
</table>

<noscript>
Ihr Browser muss JavaScript unterstützen!
</noscript>
</body>
</html>
jedenfalls klappt das schon beim ersten nicht (also nicht wundern wenn der quelltext noch nicht fertig ist ^^

findet jemand einen Fehler oder hat nen netten kleinen Tipp wie man es hinbekommen kann?
__________________
in this world of lies, the truth, it means resistance
to make the masses see and sense their needs
Heaven Shall Burn - The Weapon They Fear
Phatty ist offline   Mit Zitat antworten
Alt 27.11.2007, 22:44   #2 (permalink)
AW: on mouse over javascript in tabelle body bg

Einige Javascript-Funktionen sind casesensitiv, somit klappt bgcolor nicht, bgColor aber schon. Das Ende eines JS-Befehls mit einem Semikolon ( ; ) abschliessen. Das endet bei einer Zeile zwar nicht zwingend in einem Syntaxfehler, ist aber dennoch nicht ganz sauber.

Code:
function hintergrund(bkgcolor) {
  document.bgColor = bkgcolor;
}
Noch ein Kleiner Hinweis: Dir fehlt nocht ein </tr> und Dein Doctype passt nicht ganz zum Inhalt.

Ich hoffe ich konnte helfen.
__________________
Man reiche mir mein LART!
Kein Support bei IT-Fragen via ICQ, Skype, PN oder Email!
(Stammuser ausgenommen)
Xaicon ist offline   Mit Zitat antworten

Alt 27.11.2007, 22:59   #3 (permalink)
AW: on mouse over javascript in tabelle body bg

jupp vielen dank!

jetz klappts
__________________
in this world of lies, the truth, it means resistance
to make the masses see and sense their needs
Heaven Shall Burn - The Weapon They Fear
Phatty ist offline   Mit Zitat antworten
Antwort

Stichworte Lesezeichen
html, javascript, programmierung

Themen-Optionen

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Javascript Event Handler OnSubmit! Nikon Programmierung 3 09.02.2007 13:18
Welches JavaScript Ajax Framework nutzt ihr porschinho Programmierung 0 25.01.2007 12:28
Bundesliga Tippspielteilnehmer + Tabelle Marquinho Sport 68 25.05.2004 03:16
Microsoft Intelli Mouse tunen? Pike Hardware 2 19.03.2002 23:28



Alle Zeitangaben in WEZ +1. Es ist jetzt 14:08 Uhr.
Powered by vBulletin® Copyright ©2000 - 2008, Jelsoft Enterprises Ltd. | SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Copyright ©2008, BoardPlanet.net | Style enhanced by digital-anger.de