|
-
May 26th, 2004, 01:16 PM
#1
Thread Starter
Frenzied Member
change element
I have a bunch of table rows and I want to change the color of the rows on a mouse over and change it back on the onmouseout... I have that much working. Now I have a function which, when you click on a row, it sets the color of a row to a different color. Problem is, because of the mouseout, it changes it back to the original color as soon as I move away again.
I wrote this:
Code:
function checkchange(el)
{
var dael = document.getElementById(el);
alert(dael);
/*if(dael.style.bgColor != 'white');
dael.style.bgColor = '#DDDDDD');*/
}
But I can't seem to get it to work. I'm sending the id of the row in the onmouseout call. What am I doing wrong?
Tell me if you need to see more of the code.
-
May 26th, 2004, 11:46 PM
#2
You should set a flag.
Pseudo code:
Code:
var cell[x][y] = 0;
if clicked {
cell[x][y]=1
}
function onmouseout() {
if cell[x][y]!=1 {
(set original cell color)
}
}
..kinda thing. Know what I mean?
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
May 27th, 2004, 02:29 AM
#3
I usually do
(In the mouseover):
Code:
dael.oldclr = dael.style.backgroundColor;
dael.style.backgroundColor = highClr;
(In the mouseout):
Code:
dael.style.backgroundColor = dael.oldclr;
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|