mouseover, mouseout and onclick in a <TD>

Discussion in 'Javascript' started by Tony Farrell, Feb 26, 2004.

  1. Tony Farrell

    Tony Farrell Guest

    Hi everyone -

    I am trying to accomplish a task that i thought would be easy -
    and at this point - i'm starting to wonder...

    I have a table setup, one column, ten rows

    All the cells start off with a white background,
    as the mouse passes over the cell, the background color
    changes to a nice light blue. I have that working ok -

    but the trick comes in as - when a user clicks in the
    cell - i would like to change the background color to silver,
    and when the user moves the mouse off of the cell - the background
    will stay silver, until the user clicks another of the cells,
    then that cell switches to silver, and the rest of the cells turn
    to white...




    does anyone have code to complete this task??

    thanks
    tony
     
    Tony Farrell, Feb 26, 2004
    #1
    1. Advertisements

  2. This sounds like element abuse: tables are supposed to contain tabular
    data.
    Your specification lacks a little detail, so take a look and point out if
    something needs changing that you can't fix yourself.

    The demo page is here:

    http://www.mlwinter.pwp.blueyonder.co.uk/clj/farrell/table.html


    The two script files used are:

    http://www.mlwinter.pwp.blueyonder.co.uk/clj/farrell/core.js
    http://www.mlwinter.pwp.blueyonder.co.uk/clj/farrell/cells.js

    Be careful to note the function call in a script block at the end of the
    HTML document. That is important, and must be placed below the table.

    Mike
     
    Michael Winter, Feb 27, 2004
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.