PDA

View Full Version : Image onmouseover


Jack
08-15-2002, 03:36 PM
Could someone direct me to a source on changing the image onmouseover?

I'm just getting started with web programming. I think I understand onmouseover (ref., the onmouseover tutorial), but I don't quite understand enough to use an image instead of a color change.:confused:

I want the glow effect from a hover button in MS FrontPage, in a navigation bar using table cells.

I want a two-base-color gradient image (instead of a solid color) to replace the background color in a table cell. For example, I'll start with a blue background. Onmouseover, I want to switch to an image with a gradient red in the middle, and a gradient blue on each end.

SpongeBobby
08-15-2002, 03:46 PM
onMouseOver="this.style.backgroundColor='#ffffff'; onMouseOut="this.style.backgroundColor='#000000';

That's what i use with color, maybe you can play with it to get background...

I bet I wasn't any help at all..


Sry.

Jack
08-15-2002, 05:00 PM
I think (???) that what I'm asking is can I replace the background color codes with image codes.

Like replacing --
onMouseOver="this.style.backgroundColor='#ffffff';
with something like --
onMouseOver="this.image=http://www.xxxxxxxxxxx.xxx/xxxx.html";

Does that work -- or even make sense?

adios
08-15-2002, 05:46 PM
This is CSS - you're changing a style attribute dynamically (w/JavaScript). You can use identical code for any CSS background changes, if you use the background attribute instead of the more specific backgroundColor, backgroundImage, etc.

onMouseOver="this.style.background='#ffffff'"

onMouseOver="this.style.background='url(http://www.xxxxxxxxxxx.xxx/xxxx.html)'"

The browser 'knows' which background attribute you want altered, by its makeup.

Spend some time here (http://www.w3schools.com/css/default.asp)...

Jack
08-15-2002, 07:19 PM
The 3Schools web looks to be most helpful. I've got it bookmarked, and will work with it this evening.

When I know what to look for I pick things up mighty fast, but knowing the terms in CSS is proving to be something different from what I'm used to.

Thanks for your helpful response.:thumbsup: :thumbsup: