Jump to content

Background changes in Table


Guest macdavido

Recommended Posts

Guest macdavido

Hello,please help me with my small problem. I don''t understand why it doesn't work.There is a table with some cells:<TABLE BORDER="0" WIDTH="180" HEIGHT="150" CELLSPACING="0" CELLPADDING="0" CLASS="poland small10pt" BACKGROUND="images/bckgr_offercart.gif" ONMOUSEOVER="this.background='images/bckgr_offercartOVER.gif" ONMOUSEOUT="this.background='images/bckgr_offercart.gif'"> <TR><TD>AA</TD></TR> <TR><TD>BB</TD></TR> <TR><TD>CC</TD></TR> <TR><TD> </TD></TR></TABLE>In first line I trying with events mouseover and mouseout. There is no effect. And I don't know why ;-( please help. I have just change a background when mouse is over the table and when I get it out.RegardsMacDavidoMacOS X Tiger @ G5-Dual... "there is not like m$-not response"

Link to comment
Share on other sites

I guess that because you are missing a single quote in the MOUSEOVER event<TABLE BORDER="0" WIDTH="180" HEIGHT="150" CELLSPACING="0" CELLPADDING="0" CLASS="poland small10pt" BACKGROUND="images/bckgr_offercart.gif" ONMOUSEOVER="this.background='images/bckgr_offercartOVER.gif'" ONMOUSEOUT="this.background='images/bckgr_offercart.gif'"><TR><TD>AA</TD></TR><TR><TD>BB</TD></TR><TR><TD>CC</TD></TR><TR><TD> </TD></TR></TABLE>

Link to comment
Share on other sites

it needs to be this.style.background='yourimage.gif'

That's incorrect Little Goatthis.style.background should be used for colors ie this.style.background="red"This is correct.this.background='images/bckgr_offercartOVER.gif'If you were to use style like your code sugests then you would have to include this:this.style.backgroundImage='url(images/bckgr_offercartOVER.gif)'that is the proper code to include a background image dynamically using css route.
Link to comment
Share on other sites

That's incorrect Little Goatthis.style.background should be used for colors ie this.style.background="red"This is correct.this.background='images/bckgr_offercartOVER.gif'If you were to use style like your code sugests then you would have to include this:this.style.backgroundImage='url(images/bckgr_offercartOVER.gif)'that is the proper code to include a background image dynamically using css route.

it could also be
this.style.background='url(yourimage.gif)'

but this.background is valid as well since you can use hte background attribute in a <td>...it is just depreciated for XHTML.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...