Jeff:

Barring a browser bug (which is certainly possible), the likely culprit is a
slight logic error with the JavaScript code.  If you post the relevant code,
I'm sure the list can review it for you.

As to alternative ways of doing it, you might want to try change the cell's
Class instead of actually changing a style.  This is more CSS-compliant and,
via CSS, much easier to modify later down the line.  For example, you might
have the following CSS:

        TD {
                background-color: #006600;
        }

        TD.Highlighted {
                background-color: #FF0000;
        }

and the following JavaScript code:
        document.getElementById(CurrentHighlightedCell).className = '';
        document.getElementById(NewHighlightedCell).className = 'Highlighted';

This way, should you ever decide to change the color of the highlighted or
non-highlighted cells, you just have to change a couple of lines in the CSS
file(s).

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


Jeff W wrote:
> It appears that BOTH my example and the new.backgroundColor
> example work and don't work...
>
> As if you couldn't tell this is a background cell changer. ...and
> this code is firing on the ONCLICK of each cell :) Here is the
weirdness...
>
> Say I have 3 cells wide table... Each named menu_item1, menu_item2 and
> menu_item3 respectively. This code reverts the previous cell to
> the original cell color and is part of the code to chage the newly clicked
> cell to a different color..
>
> document.getElementById
> (CurrentHighlightedCell).style.backgroundColor='#006600';
>
> Say I click through each cell consecutively. menu_item1, menu_item2 and
then
> menu_item3 it changes each cell to the new color and the code above
> CORRECLTY changes the color back on the previous cell. That works perfect.
>
> Now the weirdness.. Say I click on menu_item3, it changes menu_item1 back
to
> the original color fine... but then I click on menu_item2, it DOES NOT
> change the color back on menu_item3 using the above code. I double checked
> and the variables are correct.. Very odd... IS there another DOM way to
> reference this?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214611
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to