Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

SOOOOOOO Simple

Options
  • 28-11-2005 3:14pm
    #1
    Closed Accounts Posts: 9


    <tr><td class="darkbrown" width="21"><img src="dot.gif" alt="Home" width="21" height="21"></td>
    <td class="mdbrown">  <a href="index.html" ><b>Home</b></td>
    <td class="ltbrown" width="9"> </td>
    </tr>

    Such a simple qus sorry guys just one of those days can't rem!!!
    I want the panel to change color when the mouse moves over it i can do it wit images but cant seem to get it workin for this today
    all help gratefully appreciated
    Thanks


Comments

  • Registered Users Posts: 3,548 ✭✭✭Draupnir


    I would have a javascript function:

    changeColour(link,onOff)
    {
    if(onOff == 0)
    {
    document.getElementById(link).className = offClass;
    }
    else
    {
    document.getElementById(link).className = onClass;
    }
    }

    and then in each cell include the attributes:

    id = "someID"

    onmouseover="changeColour(this.id,1)"

    and

    onmouseout="changeColour(this.id,0)"


    ***edited because I forgot they would need ID's!


  • Closed Accounts Posts: 4,842 ✭✭✭steveland?


    Even easier try something like:
    <table width="100%">
            <tr>
    
            <td width="100%" onmouseover="this.style.backgroundColor='#F3F7FA';" 
    onmouseout="this.style.backgroundColor='#EDF0F4';">
             <a href="page.htm">Link</a>
            </td>
            <tr>
            <td width="100%" onmouseover="this.style.backgroundColor='#EDF0F4';" 
    onmouseout="this.style.backgroundColor='#F3F7FA';">
            <a href="page.htm">Link</a>
            </td>
            </tr>
            </table>
    


  • Closed Accounts Posts: 9 ctb


    Thanks guys


  • Registered Users Posts: 3,548 ✭✭✭Draupnir


    steveland? wrote:
    Even easier try something like:
    <table width="100%">
            <tr>
    
            <td width="100%" onmouseover="this.style.backgroundColor='#F3F7FA';" 
    onmouseout="this.style.backgroundColor='#EDF0F4';">
             <a href="page.htm">Link</a>
            </td>
            <tr>
            <td width="100%" onmouseover="this.style.backgroundColor='#EDF0F4';" 
    onmouseout="this.style.backgroundColor='#F3F7FA';">
            <a href="page.htm">Link</a>
            </td>
            </tr>
            </table>
    

    good answer and much simpler!

    I was going for a slightly more effective solution, since that one code become very unreadable if you want to use a lot of css.


Advertisement