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

I can't figure out this mouseover thing.

Status
Not open for further replies.

Aishaa

Technical User
Apr 12, 2001
90
CA
Hi - I am trying to have a picture on a webpage roll over/turn into another picture, but so far I have been unable to accomplish this.

The name of the jpgs are "lady" and "lady_restored"

I have tried the tutorial on EchoEcho.com for a rollover but it just totally confused me.

Can anyone help me out?
TIA
Aishaa
 
Dreamweaver has a great roll-over script...if u have the software (dreamweaver) then all you would have to do is select the pictures and DW will add the script...
If you don't have DW, go to and download it free for a trial use... I have not failed; I merely found 100,000 different ways of not succeding...
 
This is a sample of code I used to do the same thing with links.

<a href=&quot;indexie.html&quot; onMouseOver=&quot;document.first_image.src='images/home2.bmp';&quot;
onMouseOut=&quot;document.first_image.src='images/home1.bmp';&quot;>

If you don't want your image to be a link, try this:

<onMouseOver=&quot;document.first_image.src='images/lady.jpg';&quot;
onMouseOut=&quot;document.first_image.src='images/lady_restored.jpg';&quot;>

 
I am working in Frontpage, and I tried to put in some javascript in there, but it just changed everything on me.

This one you wrote down, I will try it - is that the only thing I need? Re: <onMouseOver=&quot;document.first_image.src='images/lady.jpg';&quot;
onMouseOut=&quot;document.first_image.src='images/lady_restored.jpg';&quot;>
 
Yes. You don't have to put OnMouseover inside JavaScript tags. It's understood by HTML. There is one thing I forgot though. You have to tell it where to make the change. You do that by placing an image somewhere and naming it. So you need a little bit more in the tag:

<img src=&quot;images/lady_restored.jpg&quot; name=&quot;first_image&quot;
onMouseOver=&quot;document.first_image.src='images/lady.jpg';&quot;
onMouseOut=&quot;document.first_image.src='images/lady_restored.jpg';&quot;>


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top