thisCell.onmouseover=function(){with(tbl.rows(this.parentNode.rowIndex){style.backgroundColor='gray';style.color='red'}}
thisCell.onmouseout=function(){with(tbl.rows(this.parentNode.rowIndex)){style.backgroundColor='';style.color='#ffffff'}}
Trying to change the Font color of an entire row
Page 1 of 15 Replies - 1001 Views - Last Post: 19 April 2012 - 10:50 AM
#1
Trying to change the Font color of an entire row
Posted 15 April 2012 - 09:06 AM
I'm trying to change the font color of an entire row. I can make the code change the background color - but not the font color.
Replies To: Trying to change the Font color of an entire row
#2
Re: Trying to change the Font color of an entire row
Posted 15 April 2012 - 12:16 PM
check out the error console.
there is no sensible reason to use with() nowadays. I also wonder why you go all around with tbl.rows()? tbl.rows(this.parentNode.rowIndex) is the same as this.parentNode.
and, use indentation. it doesn’t slow down JS but makes it readable enourmously.
there is no sensible reason to use with() nowadays. I also wonder why you go all around with tbl.rows()? tbl.rows(this.parentNode.rowIndex) is the same as this.parentNode.
and, use indentation. it doesn’t slow down JS but makes it readable enourmously.
#3
Re: Trying to change the Font color of an entire row
Posted 19 April 2012 - 07:58 AM
1. I use indenting in my coding. It just didn't translate to my post.
2. What is a good alternative to with
3. Error console is no help because there is no error generated.
4. Thank you for the reponse.
2. What is a good alternative to with
3. Error console is no help because there is no error generated.
4. Thank you for the reponse.
Dormilich, on 15 April 2012 - 12:16 PM, said:
check out the error console.
there is no sensible reason to use with() nowadays. I also wonder why you go all around with tbl.rows()? tbl.rows(this.parentNode.rowIndex) is the same as this.parentNode.
and, use indentation. it doesn’t slow down JS but makes it readable enourmously.
there is no sensible reason to use with() nowadays. I also wonder why you go all around with tbl.rows()? tbl.rows(this.parentNode.rowIndex) is the same as this.parentNode.
and, use indentation. it doesn’t slow down JS but makes it readable enourmously.
#4
Re: Trying to change the Font color of an entire row
Posted 19 April 2012 - 08:11 AM
I found something that may be a hint but I still don't know why it's doing this.
If I remove
from the script then the onmouseover commands work
If I remove
this.style.color="#ffffff"
from the script then the onmouseover commands work
This post has been edited by Dormilich: 19 April 2012 - 08:22 AM
Reason for edit:: removed unnecessary quote
#5
Re: Trying to change the Font color of an entire row
Posted 19 April 2012 - 08:42 AM
I just figured it out. It was because of the
.
That was setting the color code on the cell where as the other line was updating the color on the parentNode. I changed it to
.
Code now works. I would still like to know an alternative to the with statement.
this.style.color="#ffffff"
That was setting the color code on the cell where as the other line was updating the color on the parentNode. I changed it to
this.parentNode.style.color="#ffffff"
Code now works. I would still like to know an alternative to the with statement.
ellaandcodeysdaddy, on 19 April 2012 - 08:11 AM, said:
I found something that may be a hint but I still don't know why it's doing this.
If I remove
from the script then the onmouseover commands work
If I remove
this.style.color="#ffffff"
from the script then the onmouseover commands work
#6
Re: Trying to change the Font color of an entire row
Posted 19 April 2012 - 10:50 AM
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote




|