Tabellen mit Hover Farbe


  • Mr.Pink
  • 1143 Aufrufe 7 Antworten

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Tabellen mit Hover Farbe

    hi, ich hätt da mal ne frage.

    wie mach ich eine Tabelle, bei der, wenn man drüberfährt, sich die hintergrundfarbe ändert. hab schon einiges probiert, komm aber nicht drauf!

    danke schon mal im voraus :rolleyes:
    [SIZE=1]
    Profil: [Link]
    UPLOAD for [FSB]: 15GB | [Last UP]
    Bevorzugt: jay' | Offlubo | Vuje | NuDdeLs
    [/SIZE]
  • hast glück, das hab ich letztens erst gecodet:

    PHP-Quellcode

    1. <script language="JavaScript" type="text/JavaScript">
    2. <!--
    3. function switchClass(obj,strClassName)
    4. {
    5. obj.className = strClassName;
    6. }
    7. //-->
    8. </script>


    und nun der tag für die td

    PHP-Quellcode

    1. <tr>
    2. <td class="normal" onMouseOver="switchClass(this,'hover');"
    3. onMouseOut="switchClass(this,'navbgleft');">BLA</td>
    4. </tr>


    die classes in css defenieren - und gut ist. Werd das ganze mal ins Webdesign verschieben ;).

    Gruß Jone
  • ok, erstmal thx, hab aber noch ne paar frage!

    was heißt "die classes in css defenieren"

    ich weis des ist bestimmt ne dumme frage aber ich mach des noch nicht so lange!

    und sorry das ich des thema ins falsche forum geschrieben hab.

    sers
    [SIZE=1]
    Profil: [Link]
    UPLOAD for [FSB]: 15GB | [Last UP]
    Bevorzugt: jay' | Offlubo | Vuje | NuDdeLs
    [/SIZE]
  • das heit einfach, dass du die klassen in der externen *.*css datei deklariert hast oder im

    PHP-Quellcode

    1. <head>
    2. <style type="text/css">
    3. .normal{
    4. /*Formatierung*/
    5. }
    6. .hover{
    7. /*Formatierung*/
    8. }
    9. }
    10. </style>
    11. </head>
    Alles anzeigen


    ist schon okay, bist ja noch neu hier ;).

    gruß jone
  • falls noch jemand das selbe problem wie ich hat/hatte. ich hab jetzt noch jemand anderen gefragt und so gehts, wie ich find, einfacher: aufgepasst:

    Quellcode

    1. <tr>
    2. <td [b]onmouseover=this.style.backgroundColor='C7C7C7'
    3. onmouseout=this.style.backgroundColor='A6A6A6'[/b]><font color="EB6715" size="1"></font></td>
    4. </tr>
    [SIZE=1]
    Profil: [Link]
    UPLOAD for [FSB]: 15GB | [Last UP]
    Bevorzugt: jay' | Offlubo | Vuje | NuDdeLs
    [/SIZE]