CSS Javascript Rollover
- Started
- Last post
- 5 Responses
- 187LockDown
OK everyone has seen the table cell that you rollover and it turns the BGColor of that cell to a different color. Done with the following code:
CURSOR: hand;BACKGROUND-COLOR: #ffffff"
onmouseover="this.style.backgrou... onmouseout="this.style.backgroun...What I want to do is when rolling over one cell, I would like to change the BG of another cell, I assume somehow I need to give this other cell a name and target it instead of "this". Can you help me?
- unknown0
can't answer that i'm afraid, but I think you might have to use a script combined with divs and id tags instead of using table cells
- Nairn0
use this, it'll be involved there somewhere..
document.getElementById('NameOfY...
- gabriel_pc0
Just give the table data cell an id and use the script Nairn just posted to access it's properties.
document.getElementById('tablece... = '#ffffff'
etc...
- 187LockDown0
Thanks this should help
- dessalles0
i think you'd have to give each cell a unique id. something like 'cell32' of row 3 column 2. then you could use document.getElementById(id) to access each element - where id is a string that corresponds to the name of the cell you wish to edit.
example:
id = "cell32";
document.getElementById(id).styl... = "#ABCDEF";