tutorials.de Buch-Aktion 05/2012
ERLEDIGT
NEIN
ANTWORTEN
0
ZUGRIFFE
5917
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
DIESES THEMA IST
GESCHLOSSEN
  1. #1
    Registriert seit
    Apr 2002
    Ort
    Ingolstadt
    Beiträge
    2.940
    Wie kann ich Tabellenzellen bei Mouseover highlighten?


    Einzelne Zellen:
    PHP-Code:
    <table width="200" border="1" cellpadding="1" cellspacing="0">
      <
    tr>
        <
    td onMouseover="this.bgColor='beige'" onMouseout="this.bgColor='white'">&nbsp;</td>
        <
    td onMouseover="this.bgColor='beige'" onMouseout="this.bgColor='white'">&nbsp;</td>
        <
    td onMouseover="this.bgColor='beige'" onMouseout="this.bgColor='white'">&nbsp;</td>
      </
    tr>
      <
    tr>
        <
    td onMouseOver="this.bgColor='beige'" onMouseOut="this.bgColor='white'">&nbsp;</td>
        <
    td onMouseOver="this.bgColor='beige'" onMouseOut="this.bgColor='white'">&nbsp;</td>
        <
    td onMouseOver="this.bgColor='beige'" onMouseOut="this.bgColor='white'">&nbsp;</td>
      </
    tr>
    </
    table
    Einzelne Zeilen:
    PHP-Code:
    <table width="200" border="1" cellpadding="1" cellspacing="0">
      <
    tr onMouseOver="this.bgColor='beige'" onMouseOut="this.bgColor='white'">
        <
    td>&nbsp;</td>
        <
    td>&nbsp;</td>
        <
    td>&nbsp;</td>
      </
    tr>
      <
    tr onMouseOver="this.bgColor='beige'" onMouseOut="this.bgColor='white'">
        <
    td>&nbsp;</td>
        <
    td>&nbsp;</td>
        <
    td>&nbsp;</td>
      </
    tr>
    </
    table
    Wenn man nicht alle Zellen einzeln zuweisen will, kann man das auch via Skript erreichen:
    PHP-Code:
    <script type="text/javascript">
      function 
    highlight(){
        var 
    td document.getElementsByTagName('td');
        var 
    td.length;

        for(
    i=0;i<x;i++){
            
    td[i].onmouseover = new Function("this.bgColor='beige';");
            
    td[i].onmouseout = new Function("this.bgColor='white';");
        }
      }
    </script> 
    Angehängte Dateien Angehängte Dateien
     

Ähnliche Themen

  1. XML Auslese bei mouseover highlighten. Wie?
    Von Santiago im Forum Flash Plattform
    Antworten: 1
    Letzter Beitrag: 27.01.05, 19:48
  2. dynamisch highlighten
    Von mo-ca im Forum Javascript & Ajax
    Antworten: 1
    Letzter Beitrag: 26.04.04, 20:11
  3. PHP highlighten mit bbcode
    Von Wini im Forum PHP
    Antworten: 4
    Letzter Beitrag: 05.01.04, 20:59
  4. Antworten: 6
    Letzter Beitrag: 07.10.03, 15:57
  5. problem mit highlighten
    Von DarkSummer im Forum PHP
    Antworten: 6
    Letzter Beitrag: 16.03.03, 09:08