Jump to content

Mouse Over Help


whitedark554

Recommended Posts

I don't know if its me or the tag but I tried all I could.I got a jpg img "home" and "home2" for the mouse over and a test page.I use this tag:<html><head><script LANGUAGE = "JavaScript"><!--if (document.images) { img1on = new Image();img1on.src = "home.jpg"; img1off = new Image(); img1off.src = "home2.jpg"; }function imgOn(imgName) {if (document.images) {document[imgName].src=eval(imgName + "on.src");}}function imgOff(imgName) {if (document.images) {document[imgName].src=eval(imgName + "off.src");}}// --></SCRIPT></head><body> <A HREF ="tutorial.html" onMouseOver="imgOn('img1')" onMouseOut="imgOff('img1')"><IMG SRC="home.jpg" NAME="img1" border=0></A></body></html>Is there something wrong with the tag?

Link to comment
Share on other sites

You could simply try this :)

<a href="tutorial.html" onMouseOver="this.src='home2.jpg'" onMouseOut="this.src='home.jpg'"><img src="home.jpg" style="border:opx"></a>

Link to comment
Share on other sites

Ok try this using pics from the web, change them to your pics after you see it works ok. You are still using script, it's inline now rather than in the head.

<a href="#"><img onmouseover="this.src='http://pics.ebaystatic.com/aw/pics/uk/logos/logoEbay_150x70.gif'" onmouseout="this.src='http://www.google.co.uk/intl/en_uk/images/logo.gif'" style="border:0" src="http://www.google.co.uk/intl/en_uk/images/logo.gif" width="150" height="150" /></a>

Sorry, there was a minor error in the first code i posted :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...