Web Hosting Forum | Lunarpages
News: July 14, 2008 - New Contest! - Submit Your WordPress Theme Designs, Win BIG!
September 1, 2008 - Submit Your Web Site for the Sept 2008 Site of the Month!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 08, 2008, 07:10:55 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: changing a cell's background image on mouseover  (Read 1292 times)
fstjohn
Intergalactic Superstar
*****
Offline Offline

Posts: 168



WWW
« on: March 08, 2008, 09:31:38 PM »

is there any way to do this? I can make a cell's color change - it would stand to reason that I could make the the background image change as well. - every time I search for a way to swing this, all I find via Google is a bunch of other poor saps asking boards how to do it (none of em get answered) so i figured I'd ask here!
Logged

scanman20
Master Jedi
*****
Offline Offline

Posts: 1234



WWW
« Reply #1 on: March 09, 2008, 08:17:26 AM »

Code:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
</head>

<body>

<table border="1" width="100%">
<tr>
<td onmouseover="this.style.background='#F00'" onmouseout="this.style.background=''">
&nbsp;</td>
<td onmouseover="this.style.background='#0F0'" onmouseout="this.style.background=''">
&nbsp;</td>
</tr>
<tr>
<td onmouseover="this.style.background='#00F'" onmouseout="this.style.background=''">
&nbsp;</td>
<td onmouseover="this.style.background='#F0F'" onmouseout="this.style.background=''">
&nbsp;</td>
</tr>
</table>

</body>

</html>
Logged

Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP
fstjohn
Intergalactic Superstar
*****
Offline Offline

Posts: 168



WWW
« Reply #2 on: March 09, 2008, 09:41:37 PM »

thats great  - thanks, I dont know it well enough to have it go
image 1 - image 2 - image 1

but was able to grasp enough to make it go
image 1 - color - image 1

and that'll probably good enough!

I appreciate it!
Logged

wektech
Jabba the Hutt
*****
Offline Offline

Posts: 686


WWW
« Reply #3 on: March 09, 2008, 10:41:46 PM »

There is a great example of switching between two images here: http://www.w3schools.com/jsref/jsref_onmouseout.asp
Logged

fstjohn
Intergalactic Superstar
*****
Offline Offline

Posts: 168



WWW
« Reply #4 on: March 10, 2008, 10:22:11 PM »

thanks - but if you pardon the Herman Munsterism... "darn, darn, darn, darn, darn, darn, darn, darn, darn, darn, darn, darn!"

see, I get how to swap images - and I get how to swap cell colors

what I'm looking to do is change the background images in a cell.

thought I could get by with having it go from bgimage (default) to bgcolor (mouseover) to bgimage (mouseout) and on Firefox, it looks swell! On IE? Not so much. On IE, the swappin goes bgimage(default) to bgcolor (mouseover) to white(mouseout)

you can see what I'm going for here
http://www.healthplex-ny.com/index.htm

appreciate the help so far though!
Logged

V-I-R-U-S
Spaceship Navigator
*****
Offline Offline

Posts: 75


I Love Me


WWW
« Reply #5 on: March 11, 2008, 05:22:05 AM »

Ya thats what sucks about HTML coding with different browser.

Me I bought http://www.dreamingsoft.com/order.htm 

This program is very nice and well worth the money makes Flash menus completely Customizeable, professions look with newb ease lol.

Of course there is sothinks that is a little more expensive at around 60

http://www.sothink.com/product/dhtmlmenu/index.htm

Both are nice programs, I like the sothink one the best It does have a trial version

Hope this helps Smile

Logged

scanman20
Master Jedi
*****
Offline Offline

Posts: 1234



WWW
« Reply #6 on: March 11, 2008, 09:23:48 AM »

Changing a cell's background image is virtually the same as changing the background color. Instead of using this.style.background='#ABC' use this.style.backgroundImage = url(abc.gif);
Logged

Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP
fstjohn
Intergalactic Superstar
*****
Offline Offline

Posts: 168



WWW
« Reply #7 on: March 11, 2008, 09:34:07 PM »

whoooo hooo!!!!!! thanks a million!!!!

"Changing a cell's background image is virtually the same as changing the background color."

yeah, try telling that to my client who was seeing something other than what I said I'd deliver! As soon as I wrap up this site I'm gonna spread the good word (good code?) to all the unanswered seekers out there

the only thing I needed to figure outr was that it needed quotes

'url(navbg_r.gif)'
instead of
 url(navbg_r.gif)

but hey, I aint complaining!!!!!!

thanks again!
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM