JavaScript bei Tabellen

  • #1
B

Black Panter

Bekanntes Mitglied
Themenersteller
Dabei seit
20.07.2005
Beiträge
138
Reaktionspunkte
0
Ich such nen javascript-code, womit bei tabellen, wenn man die maus auf einer spalte hat, die spalte ne anderen hintergrundfarbe bekommt. (Wie bei A:hover).
 
  • #2
Code:
<style type=text/css>
.a { background-color:#999999;}
.b { background-color:#CCCCCC;}
</style>
<script language=javascript type=text/javascript>
function changeColor(r) {
	r.className = (r.className == a) ? r.className=b : r.className=a;
}
</script>
<table align=center width=400px>
	<tr id=row_1 class=a onmouseover=changeColor(this) onmouseout=changeColor(this)>
		<td width=100%> </td>
	</tr>
	<tr id=row_2 class=a onmouseover=changeColor(this) onmouseout=changeColor(this)>
		<td width=100%> </td>
	</tr>
	<tr id=row_3 class=a onmouseover=changeColor(this) onmouseout=changeColor(this)>
		<td width=100%> </td>
	</tr>
	<tr id=row_4 class=a onmouseover=changeColor(this) onmouseout=changeColor(this)>
		<td width=100%> </td>
	</tr>
</table>

 
Thema:

JavaScript bei Tabellen

ANGEBOTE & SPONSOREN

Statistik des Forums

Themen
113.840
Beiträge
707.963
Mitglieder
51.494
Neuestes Mitglied
Flensburg45
Oben