Menu
I have cod eif user goes over Link and Image changes. But it will not be there if user goes away (not over link). How to do that image will be there all the time if user goes over Link?
Need help :rolleyes:
[code=html]
<SCRIPT LANGUAGE=”JavaScript”>
<!–
IMAGE01 = “on.gif”
IMAGE02 = “off.gif”
function imgover(imgname){
imgname.src = IMAGE01
}
function imgout(imgname){
imgname.src = IMAGE02
}
//–>
</SCRIPT>
and code for image:
[code=html]
<IMG NAME=”IMAGE01″ SRC=”off.gif” WIDTH=10 HEIGHT=10 BORDER=0>
<A HREF=”http://www.Mywebsite.com” onMouseOver=”imgover(IMAGE01)” onMouseOut=”imgout(IMAGE01)”>Altavista</A>
<i>
</i><SCRIPT type="text/javascript">
function imgover(imgname)
{
document.getElementByName(imgname).src = "on.gif";
}
function imgover(imgname)
{
document.getElementByName(imgname).src = "off.gif";
}
</SCRIPT>
<i>
</i><IMG NAME="IMAGE01" SRC="off.gif" WIDTH=10 HEIGHT=10 BORDER=0>
<A HREF="http://www.Mywebsite.com" onMouseOver="javascript:document.getElementByName('IMAGE1').src = 'on.gif';
" onMouseOut="javascript:document.getElementByName('IMAGE1').src = 'off.gif';
">Altavista</A>
[code=html]
<SCRIPT LANGUAGE="JavaScript">
IMAGE01 = "image14.gif"
IMAGE02 = "off.gif"
function imgover(imgname){ imgname.src = IMAGE01 }
function imgout(imgname){ imgname.src = IMAGE02 }
</SCRIPT>
[/code]
[code=html]
<IMG NAME="IMAGE01" SRC="off.gif" WIDTH=10 HEIGHT=10 BORDER=0> <A HREF="http://www.Mywebsite.com" onMouseOver="imgover(IMAGE01)" onMouseOut="imgout(IMAGE01)">Altavista</A>
[/code]
<i>
</i><SCRIPT type="text/javascript">
IMAGE01 = "image14.gif"
IMAGE02 = "off.gif"
function imgover(imgname){ document.getElementByName(imgname).src = IMAGE01; }
function imgout(imgname){ document.getElementByName(imgname).src = IMAGE02; }
</SCRIPT>
document.getElementByName(imgname).src
document.getElement[b]s[/b]ByName(imgname)[b][0][/b].src
<i>
</i><IMG NAME="IMAGE01" id="IMAGE01" SRC="off.gif" WIDTH=10 HEIGHT=10 BORDER=0>
<A HREF="http://www.Mywebsite.com" onMouseOver="javascript:document.getElementById('IMAGE1').src='image14.gif';
" onMouseOut="javascript:document.getElementById('IMAGE1').src='off.gif';
">Altavista</A>
[code=html]
<img src="Image1" /><img src="Image2" /><img src="Image3" /><img src="Image4" />
<table>
<tr>
<td><img name="" src="main.gif" border="2" width="250" height="125"
align="middle" alt=""></td>
</tr>
</table>
[/code]
<a href="" onmouseover="document.getElementById('mainimg').src=this.href;" onmouseour="document.getElementById('mainimg').src='main.gif';"><img src="Image1" alt="short description of image" /></a>
<i>
</i>function switchGIF(ID)
{
var i;
var baser = "http://mysite/html/"
var myarray=new Array('image1.gif','mainimage1a.gif','image2.gif','mainimage2a.gif','image3.gif','mainimage3a.gif','image4.gif','mainimage4a.gif');
for(i=0;i<myarray.length;i++)
{
if ((document.getElementById(ID).src==(baser + myarray[i])) && ((i%2)==0))
{
document.getElementById(ID).src=myarray[i+1];
i= myarray.length;
}
else if ((document.getElementById(ID).src==(baser + myarray[i])) && ((i%2)==1))
{
document.getElementById(ID).src=myarray[i-1];
i= myarray.length;
}
}
}
</script>
<i>
</i><img name="img1" id="img1" src="mainimage1a.gif" onmouseover="this.src=image1.gif;" onmouseout="this.src=mainimage1a.gif;">
<img name="img2" id="img2" src="mainimage2a.gif" onmouseover="this.src=image2.gif;" onmouseout="this.src=mainimage2a.gif;">
<img name="img3" id="img3" src="mainimage3a.gif" onmouseover="this.src=image3.gif;" onmouseout="this.src=mainimage3a.gif;">
<img name="img4" id="img4" src="mainimage4a.gif" onmouseover="this.src=image4.gif;" onmouseout="this.src=mainimage4a.gif;">
[code=html]
<img name="img1" id="img1" src="mainimage1a.gif" onmouseover="switchGIF(this.id)" onmouseout="this.src=mainimage1a.gif;">
<img name="img2" id="img2" src="mainimage2a.gif" onmouseover="switchGIF(this.id)" onmouseout="this.src=mainimage2a.gif;">
<img name="img3" id="img3" src="mainimage3a.gif" onmouseover="switchGIF(this.id)" onmouseout="this.src=mainimage3a.gif;">
<img name="img4" id="img4" src="mainimage4a.gif" onmouseover="switchGIF(this.id)" onmouseout="this.src=mainimage4a.gif;">
[/code]
<i>
</i><html>
<head>
<script type="text/javascript">
function switchGIF(ID)
{
var i;
var baser = "http://www.mysite.com/html/"
var myarray=new Array('image1.gif','mainimage1a.gif','image2.gif','mainimage2a.gif','image3.gif','mainimage3a.gif',' image4.gif','mainimage4a.gif');
for(i=0;i<myarray.length;i++)
{
if ((document.getElementById(ID).src==(baser + myarray[i])) && ((i%2)==0))
{
document.getElementById(ID).src=myarray[i+1];
i= myarray.length;
}
else if ((document.getElementById(ID).src==(baser + myarray[i])) && ((i%2)==1))
{
document.getElementById(ID).src=myarray[i-1];
i= myarray.length;
}
}
}
</script>
</head>
<body>
<img name="img1" id="img1" src="mainimage1a.gif" onmouseover="switchGIF(this.id)" onmouseout="switchGIF(this.id)">
<img name="img2" id="img2" src="mainimage2a.gif" onmouseover="switchGIF(this.id)" onmouseout="switchGIF(this.id)">
<img name="img3" id="img3" src="mainimage3a.gif" onmouseover="switchGIF(this.id)" onmouseout="switchGIF(this.id)">
<img name="img4" id="img4" src="mainimage4a.gif" onmouseover="switchGIF(this.id)" onmouseout="switchGIF(this.id)">
<input type="text" id="one" size="80">
</body>
</html>
<i>
</i><html>
<head>
<script type="text/javascript">
function switchGIF(ID)
{
var i;
var baser = "http://www.w3schools.com/html/"
var myarray=new Array('image1.gif','mainimage1a.gif','image2.gif','mainimage2a.gif','image3.gif','mainimage3a.gif',' image4.gif','mainimage4a.gif');
for(i=0;i<myarray.length;i++)
{
if ((document.getElementById(ID).src==(baser + myarray[i])) && ((i%2)==0))
{
document.getElementById(ID).src=myarray[i+1];
i= myarray.length;
}
else if ((document.getElementById(ID).src==(baser + myarray[i])) && ((i%2)==1))
{
document.getElementById(ID).src=myarray[i-1];
i= myarray.length;
}
}
document.getElementById('one').value = document.getElementById(ID).src;
}
</script>
</head>
<body>
<img name="img1" id="img1" src="mainimage1a.gif" onmouseover="switchGIF(this.id)" onmouseout="switchGIF(this.id)">
<img name="img2" id="img2" src="mainimage2a.gif" onmouseover="switchGIF(this.id)" onmouseout="switchGIF(this.id)">
<img name="img3" id="img3" src="mainimage3a.gif" onmouseover="switchGIF(this.id)" onmouseout="switchGIF(this.id)">
<img name="img4" id="img4" src="mainimage4a.gif" onmouseover="switchGIF(this.id)" onmouseout="switchGIF(this.id)">
<input type="text" id="one" size="80">
</body>
</html>
0.1.9 — BETA 5.17