Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

SOOOOOOO Simple

  • 28-11-2005 03: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, Registered Users 2 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, Registered Users 2 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