Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the Background image of a Cell

Status
Not open for further replies.

inta

Technical User
Aug 2, 2001
13
AU
Is there a way to change the background image of a cell using onmouseover and onmouseout events?

I am looking for a solution that works with both NS4 and above, and IE5 and above

Thank you for your assistance.
 
hmmm....

Code:
function changeBG(obj,img){
if (document.all){
obj.style.backgroundImage=img;
} else if (document.layers){
obj.style.background=img;
}
}

thats the function, here's the example

Code:
<table>
<tr><td onmouseover=changeBG(this,'test.gif') onmouseout=changeBG(this,'test.gif')> </td></tr>
</table>

that should work, if you change text.gif to a real image
theEclipse
eclipse_web@hotmail.com
**\\||It was recently discovered that research causes cancer in rats||//**
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top