mgraham
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by mgraham
-
-
Is it considered poor practise to use many temporary variables to store in-progress values like this:
ts = document.getElementById("1s-quantity").value; quantity1s = Number(ts);
when one could compress that into
quantity1s = Number(document.getElementbyId("1s-quantity").value);
I use a lot of temporary variables so that I can see what is going on step by step when I'm debugging. When the code works I generally don't bother compressing it again, and I'm just curious whether there is any good reason to.
Mike
Inheritance problem, maybe?
in CSS
Posted
I have a table in which I want to set the :hover value to give me a reverse video effect using this code:
table.checklist-table th:hover,table.checklist-table td:hover { color: white; background-color: rgba(0,0,256,1);}
The weird thing is that the background colour changes but the foreground text colour does not. Instead it keeps the general body text colour specified here:
body { color: #222; height: auto; height: 100%; line-height: 1.3em; min-height: 100%;}
I really don't understand why it's using the inherited color when the rule for the table is so very much more particular, and it *is* changing the background so I know the rule is triggering, it's just not using the "color: white".
Any thoughts?
Mike