Click to See Complete Forum and Search --> : [RESOLVED] New Member: Need Help With Changing Background Of Cell


cryztal
08-12-2006, 04:03 PM
I know nothing about CSS

Here is my problem:

I am trying to change the background of a cell named (mycell) when a button is clicked.

The button is in an iframe and uses this code:

<td><a href="f8-7f8.htm" target="submenu" onClick="MM_nbGroup('down','group1','factor8','molink1.jpg',1)" onMouseOver="MM_nbGroup('over','factor8','molink1.jpg','link1.jpg',1)" onMouseOut="MM_nbGroup('out')"><img src="link1.jpg" alt="" name="factor8" width="73" height="37" border="0" align="top" onload=""></a></td>


A person in the java forum gave me the following info:

Build a CSS class

.newbg{
background-image:url(newbg.jpg);
}

Now switch the class

<a href="whicheverurl" onclick="document.getElementById('mycell').className='newbg'">link</a>


I have been trying to figure this out for days and am at the point of maddness - can someone please give me step by step instructions on where i put this information in my code:

I put the .newbg{background-image:url(newbg.jpg);} in the body of the main page - not sure if that is what I am suppose to do or not and then when it came to inserting the <a href info I figured this would go in the url that holds the menu button but had no idea where to put it -

I feel so stupid but I have to get this effect done - its the only thing holding me up - PLEASE HELP - :eek:

WebJoel
08-12-2006, 06:02 PM
"....I put the .newbg{background-image:url(newbg.jpg);} in the body of the main page - not sure if that is what I am suppose to do..."

No, that is STYLE information and it goes BEFORE the closing of the head tag (before </head>), not 'in the body' where it will not work at all.

Therefore:

<style>
.newbg{background-image:url(newbg.jpg);}
</style>

</head>
<body> etc etc etc

Also, that other part is "javascript", not "java"... Totally different language.