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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing cell background image 2

Status
Not open for further replies.

netflyeruk

Programmer
Sep 10, 2003
6
GB
I have a query regarding cell background images. Have placed text in a cell which has an image background (using properties).

Would like the cell background image (BUT NOT THE TEXT) to change to a different image 'onmouseover'. Can't seem to find a behaviour that will let me do this.

I know I could add the text to the background images and use a rollover but text looks a bit 'fuzzy' this way.

Would appreciate any suggestions,

Bill
 
netflyeruk: How different are your 'images' in the up state and over states? Are they pics or just solid colours? Do you have Photoshop & ImageReady?

"Understand life as it parallels your environment .. and things start to look up"
 
I guess you might be able to add a javascript function that would do this for you.

Cheech

[Peace][Pipe]
If you don't stand up for something, you'll fall down. Toke it Easy.
Howard Marks.
 
lineofvision/cheech:

Both images are jpeg graphics, same dimensions (sized to fit cell). I have Photoshop/ImageReady.
Was hoping to do this without javascript (my limitations!) but maybe will have to go this route.
Would it be any easier if I used CSS to insert the background image(s) in the cell?
 
netflyer,
Can you provide a url with sample images/concept? Should be able to do this without java.

"Understand life as it parallels your environment .. and things start to look up"
 
Don't have a URL as yet but as a very simple example of the concept.... Car X comes in 2 colours (could it be a Ford?)and there is a small picture of a red car (background image) with descriptive text overlaid. On 'mouseover' the picture changes to a blue car with the text staying the same. Any link from the picture to a new page would be via a mouse click on the text (with the underlines removed).

I'm new to DW and am probably trying to do a simple task in a difficult way but I find text on rollover images (the easy way to do the example above) is not crisp and clear like it is when inserted directly within DW.

Maybe I'm just too picky!
 
i would use layers for that.
insert the image directly into the cell, draw a layer over the cell and type the text in it. in the onmouseover event of the text change the image...

hth

Known is handfull, Unknown is worldfull
 
for colors
and for images:
Code:
<STYLE>
    .setUrl  { background-image: url(sphere.jpg) }
    .loseUrl { background-image: url(none) }
</STYLE>
</HEAD> 
<BODY> 
<SPAN STYLE=&quot;font-size:14&quot; onmouseover=&quot;this.className='setUrl'&quot;
    onmouseout=&quot;this.className='loseUrl'&quot;>
. . . </SPAN>
u can apply it to cells vs. span
All the best!

> need more info?
:: don't click HERE ::
 
vbkris, lebisol, Thanks for advice.

lebisol: I tried this code and was partly successful. The <STYLE> bit works OK, I replaced 'sphere' and 'none' with my 2 images. 'seturl' and 'loseurl' appear as CSS styles and I applied these to the cell. Images are visible in browser when checked.

The <SPAN STYLE> bit does not seem to do anything (mouseover has no effect). Can you explain how this is applied to the cell?

Thanks
 
like so:
Code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<STYLE>
    .setUrl  { background-image: url(images/image.jpg) }
    .loseUrl { background-image: url(none) }
</STYLE>
</head>
<body>
<table width=&quot;330&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
  <tr>
    <td align=&quot;center&quot; onmouseover=&quot;this.className='setUrl'&quot; onmouseout=&quot;this.className='loseUrl'&quot;> cell 1</td>
    <td align=&quot;center&quot; onmouseover=&quot;this.className='setUrl'&quot; onmouseout=&quot;this.className='loseUrl'&quot;>cell 2</td>
    <td align=&quot;center&quot; onmouseover=&quot;this.className='setUrl'&quot; onmouseout=&quot;this.className='loseUrl'&quot;>cell 3</td>
  </tr>
</table>
</body>
</html>
All the best!

> need more info?
:: don't click HERE ::
 
lebisol.

just back from holiday, tried what you suggested and got things working fine. I finally got my head round what you were telling me! (I'm a bit slow sometimes).

Thanks a lot for your support and patience, very much appreciated.

Regards,
 
:)
great, glad to hear it!
All the best!

> need more info?
:: don't click HERE ::
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top