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

Can a CSS stylesheet function swap images using OnMouseOver / rollover 3

Status
Not open for further replies.

lesj1968

Programmer
Sep 3, 2005
166
GB
Hi

Please can anyone tell me if there is a CSS stylesheet function class that can swap images using OnMouseOver or Rollover? I have a menu system and would like to apply a class to the current image that is representing each root menu option.

Thank you for any help.

Les
 
Javascript can be disabled on any browser, but by default it is enabled on all the ones I have ever installed. I imagine the embedded browsers in some of the mobile phones may have a reduced javascript core - but they do support the main things.

If you are doing JS development I can't help but recommend looking at the Venkeman debugger in Firefox (although I think it's now available in some other browsers). If nothing else, it'll prove invaluable as you port your javascript code from IE (although there is a good chance your code will work as-is or with minor changes).

It's a rare luxury to be in a single browser environment... enjoy it while you can [smile]

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
Please can anyone provide help on this... on how to make an image swap if a mouse is hovered over it?

Many thanks.
 
Why not use Javascript ?.

Code:
<img id="pic" src="picture0.jpg" OnMouseOver="document.getElementById('pic').src='picture1.jpg';" OnMouseOut="document.getElementById('pic').src='picture0.jpg';" height="70px" width="70px">
 
Users at Tek Tips are sometimes more inclined to help people that actually show some initiative when they are presented with complete working examples of what they want. In light of this revelation, I will give you a link. It might look somewhat familiar, but I guess that's because it appeared here before. How about you try the technique described here:
 
I can't help but feel I've seen that link somewhere before, could you post it again so I can take a closer look. ;-)
 
Great Link Chrissie, Have a Star......ahem..lol
 
here's the link:

Now where's my star?

-kaht

How much you wanna make a bet I can throw a football over them mountains?
sheepico.jpg
images
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top