Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mogzieee

macrumors 6502a
Original poster
Feb 8, 2008
668
1
London, UK
If theres any web designer out there can they help me please!

I'm making an HTML webpage, but i can't get this rollover image/link to work... is there something wrong with the code below?? Or is it just my computer messing up??

<A
HREF="www.google.com"
onMouseOver = "rollover('home')";
onMouseOut = "rollout('home')";
><IMG SRC="home_out.gif";
NAME="home";
ALT="Home Page"; BORDER=0
HEIGHT=130 WIDTH=115
></A>
<SCRIPT TYPE="text/javascript">
<
setrollover("home_over.gif");
>
</SCRIPT>


Some other things to note (that may help you):
* my pictures "home_out" and "home_over" are in .gif format and saved on the Desktop
* my html site is also saved on the desktop for the time being....



ANY help would be GREATLY appreciated...! THANKS
 
Can you provide more of the JavaScript? You only provided one line and it doesn't have any meaning on its own.
 
I think since he only provided one line, thats the problem. I don't think the Java is programmed into. I could be wrong, its been awhile since I've coded that particular thing, but I'm sure there is more to it.
 
<html>
<head>
<script language="JavaScript">
<!-- hide
function mouseOverPaint(){
document.namepix.src ="pixover.jpg"
}

function mouseOutPaint(){
document.namepix.src ="pixout.jpg"
}
//-->
</script>
</head>
<body>
<A HREF="#" onmouseOver="mouseOverPaint()" onmouseOut="mouseOutPaint()" >
<IMG name="namepix" src="pixout.jpg"/>
</A>
</body>
</html>



A good place to check and learn html/javascript is http://www.w3schools.com/js/default.asp
 
Or something like. Keep in mind you have to make an image that has the normal state on one side, and the rollover on the other, so the size below is half of the original image size.

Here is the image.

http://www.chicowebdesign.com/images/nav/home.gif

Code:
#home a, #home a:link, #home a:visited {
	background: url(imgs/nav/home.gif) 0 0 no-repeat;
	width: 100px;
}

#home a:hover  {
	background-position: -100px 0;
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.