Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    Cambia colore alle tabelle al passagio del mouse

    Come faccio in html/javascript a dire che al passaggio del mouse su un atabella, si cambia il colore, o un'altro attributo? thenk

    P.S.

    ecco un'esempio

    http://www.php-stats.com/stats/admin...ion=os_browser
    Chiamatemi sven se volete non ho voglia di fare una nuova email per una nuova registrazione xD
    Mac Future User , Ventilatore for PC Cooler user , - dry is coming -

  2. #2
    up
    Chiamatemi sven se volete non ho voglia di fare una nuova email per una nuova registrazione xD
    Mac Future User , Ventilatore for PC Cooler user , - dry is coming -

  3. #3
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    con una ricerchina saltano fuori thread del genere
    http://forum.html.it/forum/showthrea...hreadid=587402
    http://forum.html.it/forum/showthrea...hreadid=562889

    cmq il codice usato nella pagina è questo
    codice:
    <html>
    <head>
    <script type="text/javascript">
    function setPointer(theRow, thePointerColor, theNormalBgColor){
        var theCells=null;
        if(thePointerColor == '' || typeof(theRow.style) == 'undefined') {
            return false;
        }
        if(typeof(document.getElementsByTagName) != 'undefined') {
            theCells=theRow.getElementsByTagName('td');
        }
        else if(typeof(theRow.cells) != 'undefined') {
            theCells=theRow.cells;
        }
        else {
            return false;
        }
        var rowCellsCnt =theCells.length;
        var currentColor=null;
        var newColor    =null;
        // Opera does not return valid values with "getAttribute"
        if(typeof(window.opera) == 'undefined'
            && typeof(theCells[0].getAttribute) != 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
            currentColor=theCells[0].getAttribute('bgcolor');
            newColor    =(currentColor.toLowerCase() == thePointerColor.toLowerCase())
                         ? theNormalBgColor
                         : thePointerColor;
            for (var c=0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        else {
            currentColor=theCells[0].style.backgroundColor;
            newColor    =(currentColor.toLowerCase() == thePointerColor.toLowerCase())
                         ? theNormalBgColor
                         : thePointerColor;
            for (var c=0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor=newColor;
            }
        }
    
        return true;
    } // end of the 'setPointer()' function
    </script>
    </head>
    <body>
    <table>
    <tr onmouseover="setPointer(this, '#CCCCCC', '#EEEEEE')" onmouseout="setPointer(this, '#EEEEEE', '#EEEEEE')">
    <td bgcolor=#EEEEEE width="14">[img]images/browsers.php?q=Safari[/img]</td><td bgcolor=#EEEEEE align="right"><span class="tabletextA">Safari</span></td><td bgcolor=#EEEEEE align="right"><span class="tabletextA">245</span>
    <span class="tabletextA">21</span></td><td bgcolor=#EEEEEE><span class="tabletextA">[img]templates/viewsource/images/style_bar_1.gif[/img] (1.9%)</span>
    <span class="tabletextA">[img]templates/viewsource/images/style_bar_2.gif[/img] (2.1%)</span></td>
    </tr></table>
    </body>
    </html>
    ciao

  4. #4
    THKS
    Chiamatemi sven se volete non ho voglia di fare una nuova email per una nuova registrazione xD
    Mac Future User , Ventilatore for PC Cooler user , - dry is coming -

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.