![]() |
|
Alles rund um Windows: css-klasse von tabellen-zellen verändernWindows 7 Hilfe zu allen Windows-Betriebssystemen: Windows XP, Windows Vista, Windows 7, Windows 8(.1) und Windows 10 / Windows 11- als auch zu sämtlicher Windows-Software. Alles zu Windows 10 ist auch gerne willkommen. Bitte benenne etwaige Fehler oder Bluescreens unter Windows mit dem Wortlaut der Fehlermeldung und Fehlercode. Erste Schritte für Hilfe unter Windows. |
![]() | #1 |
![]() ![]() | ![]() Problem: css-klasse von tabellen-zellen verändern folgendes problem: ich hab ne tabelle mit x zellen, bei mouseover, mouseout und mousedown soll sich die farbe ändern. normal ist grau, bei over wirds blau, bei out wieder grau und bei click wirds orange, nur soll die orange-eingefärbte zelle auch so lange orange bleiben bis ich ne andere anklicke. source: </font><blockquote>Code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">var theMarkedRow = null; function setPointerClass(theRow, theRowNum, theAction, DefaultClass, PointerClass, ClickClass) { if ((PointerClass == "" && ClickClass == "" ![]() ![]() return false; } var c = null; var theCells = theRow.getElementsByTagName("td" ![]() var MarkedCells = null; var MarkedCellsCnt = null; var newClass = DefaultClass; var rowCellsCnt = theCells.length; var currentClass = theCells[0].className; if(theMarkedRow != null && theAction == "click" ![]() MarkedCells = theMarkedRow.getElementsByTagName("td" ![]() MarkedCellsCnt = MarkedCells.lenght for(c=0; c < MarkedCellsCnt; c++) { MarkedCells[c].className = DefaultClass; } theMarkedRow = null; } if(theMarkedRow == null) { theMarkedRow = theRow; } for (c = 0; c < rowCellsCnt; c++) { if(theAction == "click" ![]() newClass = ClickClass; } else if(theAction == "over" ![]() newClass = PointerClass; } else { newClass = DefaultClass; } theCells[c].className = newClass; } return true; }</pre>[/QUOTE]im html-source: </font><blockquote>Code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"><tr onmouseover="setPointerClass(this, 0, 'over', 'td_off', 'td_over', 'td_on')" onmouseout="setPointerClass(this, 0, 'out', 'td_off', 'td_over', 'td_on')" onmousedown="setPointerClass(this, 0, 'click', 'td_off', 'td_over', 'td_on')"></pre>[/QUOTE]in "theMarkedRow" wird auch ein objekt abgespeichert, trotzdem funzt es nicht *gnarf*
__________________ Wir sind Borg. Widerstand ist Spannung durch Stromstärke. |
Themen zu css-klasse von tabellen-zellen verändern |
andere, blau, bleibe, click, code, false, farbe, folge, folgendes, funzt, grau, lange, nicht, objekt, orange, problem, style, tabelle, this |