APCosta
10-03-2005, 03:30 PM
Hello! I have a code for image change on mouse over, but all the imagens change at the same place! See:
http://qorganica.no.sapo.pt/base8.htm
The code is simple and works except for the image change (they all change in image1) Can anyone help me correcting this??? Or the code is supose to do this?
Thanx,
A. Pontes da Costa
The code is:
<!-- TWO STEPS TO INSTALL PRELOAD IMAGES:
1. Paste the first into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
image1 = new Image();
image1.src = "http://qorganica.no.sapo.pt/imagens/botoes/qseu-2.gif";
image2 = new Image();
image2.src = "http://qorganica.no.sapo.pt/imagens/botoes/liv-2.gif";
image3 = new Image();
image3.src = "http://qorganica.no.sapo.pt/imagens/botoes/link-2.gif";
image4 = new Image();
image4.src = "http://qorganica.no.sapo.pt/imagens/botoes/friends-2.gif";
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert this code into the BODY of your HTML document -->
<BODY>
<a href="http://qorganica.no.sapo.pt/imagens/botoes/qse.htm" onmouseover="image1.src='http://qorganica.no.sapo.pt/imagens/botoes/qseu-2.gif';"
onmouseout="image1.src='http://qorganica.no.sapo.pt/imagens/botoes/qseu.gif';">
<img name="image1" src="http://qorganica.no.sapo.pt/imagens/botoes/qseu.gif" border=0></a>
<a href="http://qorganica.no.sapo.pt/imagens/botoes/liv.htm" onmouseover="image2.src='http://qorganica.no.sapo.pt/imagens/botoes/liv-2.gif';"
onmouseout="image2.src='http://qorganica.no.sapo.pt/imagens/botoes/liv.gif';">
<img name="image2" src="http://qorganica.no.sapo.pt/imagens/botoes/liv.gif" border=0></a>
<a href="http://qorganica.no.sapo.pt/imagens/botoes/link.htm" onmouseover="image3.src='http://qorganica.no.sapo.pt/imagens/botoes/link-2.gif';"
onmouseout="image3.src='http://qorganica.no.sapo.pt/imagens/botoes/link.gif';">
<img name="image3" src="http://qorganica.no.sapo.pt/imagens/botoes/link.gif" border=0></a>
<a href="http://qorganica.no.sapo.pt/imagens/botoes/friend.gif" onmouseover="image4.src='http://qorganica.no.sapo.pt/imagens/botoes/friends-2.gif';"
onmouseout="image4.src='http://qorganica.no.sapo.pt/imagens/botoes/friends.gif';">
<img name="image4" src="http://qorganica.no.sapo.pt/imagens/botoes/friends.gif" border=0></a>
</BODY>
http://qorganica.no.sapo.pt/base8.htm
The code is simple and works except for the image change (they all change in image1) Can anyone help me correcting this??? Or the code is supose to do this?
Thanx,
A. Pontes da Costa
The code is:
<!-- TWO STEPS TO INSTALL PRELOAD IMAGES:
1. Paste the first into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
image1 = new Image();
image1.src = "http://qorganica.no.sapo.pt/imagens/botoes/qseu-2.gif";
image2 = new Image();
image2.src = "http://qorganica.no.sapo.pt/imagens/botoes/liv-2.gif";
image3 = new Image();
image3.src = "http://qorganica.no.sapo.pt/imagens/botoes/link-2.gif";
image4 = new Image();
image4.src = "http://qorganica.no.sapo.pt/imagens/botoes/friends-2.gif";
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert this code into the BODY of your HTML document -->
<BODY>
<a href="http://qorganica.no.sapo.pt/imagens/botoes/qse.htm" onmouseover="image1.src='http://qorganica.no.sapo.pt/imagens/botoes/qseu-2.gif';"
onmouseout="image1.src='http://qorganica.no.sapo.pt/imagens/botoes/qseu.gif';">
<img name="image1" src="http://qorganica.no.sapo.pt/imagens/botoes/qseu.gif" border=0></a>
<a href="http://qorganica.no.sapo.pt/imagens/botoes/liv.htm" onmouseover="image2.src='http://qorganica.no.sapo.pt/imagens/botoes/liv-2.gif';"
onmouseout="image2.src='http://qorganica.no.sapo.pt/imagens/botoes/liv.gif';">
<img name="image2" src="http://qorganica.no.sapo.pt/imagens/botoes/liv.gif" border=0></a>
<a href="http://qorganica.no.sapo.pt/imagens/botoes/link.htm" onmouseover="image3.src='http://qorganica.no.sapo.pt/imagens/botoes/link-2.gif';"
onmouseout="image3.src='http://qorganica.no.sapo.pt/imagens/botoes/link.gif';">
<img name="image3" src="http://qorganica.no.sapo.pt/imagens/botoes/link.gif" border=0></a>
<a href="http://qorganica.no.sapo.pt/imagens/botoes/friend.gif" onmouseover="image4.src='http://qorganica.no.sapo.pt/imagens/botoes/friends-2.gif';"
onmouseout="image4.src='http://qorganica.no.sapo.pt/imagens/botoes/friends.gif';">
<img name="image4" src="http://qorganica.no.sapo.pt/imagens/botoes/friends.gif" border=0></a>
</BODY>