This is my code.
<html>
<head>
<style><!--
#slidemenubar, #slidemenubar2{
position:absolute;
left:10px;
height:200px;
width:200px;
top:50px;
border:0;
background-color:white;
font:bold 12px Verdana;}
--></style>
<script><!--
var g_images = new Array();
g_images[0] = new Image();
g_images[0].src = "News1.gif";
g_images[1] = new Image();
g_images[1].src = "News2.gif";
g_images[2] = new Image();
g_images[2].src = "AdminButton1.gif";
g_images[3] = new Image();
g_images[3].src = "AdminButton2.gif";
g_images[4] = new Image();
g_images[4].src = "Links1.gif";
g_images[5] = new Image();
g_images[5].src = "Links2.gif";
g_images[6] = new Image();
g_images[6].src = "Home1.gif";
g_images[7] = new Image();
g_images[7].src = "Home2.gif";
function imgRotate(nIndex){
if ( g_images[0].complete)
document.images[1].src = g_images[nIndex].src;}
function imgRotate2(nIndex){
if ( g_images[2].complete)
document.images[3].src = g_images[nIndex].src;}
function imgRotate3(nIndex){
if ( g_images[4].complete)
document.images[5].src = g_images[nIndex].src;}
function imgRotate4(nIndex){
if ( g_images[6].complete)
document.images[7].src = g_images[nIndex].src;}
//-->
</script>
</head>
<body>
<script language="JavaScript1.2">if (document.all)
document.write('<div id="slidemenubar2" style="left:-175" border="5" onMouseover="pull()" onMouseout="draw()">')
</script>
<layer id="slidemenubar" style="left:-185" border="5" onMouseOver="pull()" onMouseOut="draw()">
<a href="#" onMouseDown="javascript:imgRotate(1)" onMouseUp="javascript:imgRotate(0)">
<img src="News1.gif" height="50" width="200"></a>
<a href="#" onMouseDown="javascript:imgRotate2(3)" onMouseUp="javascript:imgRotate2(2)">
<img src="AdminButton1.gif" height="50" width="200"></a>
<a href="#" onMouseDown="javascript:imgRotate3(5)" onMouseUp="javascript:imgRotate3(4)">
<img src="Links1.gif" height="50" width="200"></a>
<a href="#" onMouseDown="javascript:imgRotate4(7)" onMouseUp="javascript:imgRotate4(6)">
<img src="Home1.gif" height="50" width="200"></a></layer>
<script language="JavaScript1.2">function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",400)
}
window.onload=regenerate2
if (document.all){
document.write('</div>')
themenu=document.all.slidemenubar2.style
rightboundary=0
leftboundary=-175
}
else{
themenu=document.layers.slidemenubar
rightboundary=170
leftboundary=10
}
function pull(){
if (window.drawit)
clearInterval(drawit)
pullit=setInterval("pullengine()",50)
}
function draw(){
clearInterval(pullit)
drawit=setInterval("drawengine()",30)
}
function pullengine(){
if (document.all&&themenu.pixelLeft<rightboundary)
themenu.pixelLeft+=25
else if(document.layers&&themenu.left<rightboundary)
themenu.left+=25
else if (window.pullit)
clearInterval(pullit)
}
function drawengine(){
if (document.all&&themenu.pixelLeft>leftboundary)
themenu.pixelLeft-=5
else if(document.layers&&themenu.left>leftboundary)
themenu.left-=5
else if (window.drawit)
clearInterval(drawit)
}
</script>
</body>
</html>
Now, here is my problem. When someone clicks on the graphical link, the imgRotate function is initiated. The problem is that the function rotates the image for the graphical link sitting under the one clicked. I'm still learning good/bad habits in javascript, so my script is sloppy. There is probably a way to use one function to call each of the images at the time needed. Any insight anyone can give is greatly apprectiated. I hope someone out there can help me.
<html>
<head>
<style><!--
#slidemenubar, #slidemenubar2{
position:absolute;
left:10px;
height:200px;
width:200px;
top:50px;
border:0;
background-color:white;
font:bold 12px Verdana;}
--></style>
<script><!--
var g_images = new Array();
g_images[0] = new Image();
g_images[0].src = "News1.gif";
g_images[1] = new Image();
g_images[1].src = "News2.gif";
g_images[2] = new Image();
g_images[2].src = "AdminButton1.gif";
g_images[3] = new Image();
g_images[3].src = "AdminButton2.gif";
g_images[4] = new Image();
g_images[4].src = "Links1.gif";
g_images[5] = new Image();
g_images[5].src = "Links2.gif";
g_images[6] = new Image();
g_images[6].src = "Home1.gif";
g_images[7] = new Image();
g_images[7].src = "Home2.gif";
function imgRotate(nIndex){
if ( g_images[0].complete)
document.images[1].src = g_images[nIndex].src;}
function imgRotate2(nIndex){
if ( g_images[2].complete)
document.images[3].src = g_images[nIndex].src;}
function imgRotate3(nIndex){
if ( g_images[4].complete)
document.images[5].src = g_images[nIndex].src;}
function imgRotate4(nIndex){
if ( g_images[6].complete)
document.images[7].src = g_images[nIndex].src;}
//-->
</script>
</head>
<body>
<script language="JavaScript1.2">if (document.all)
document.write('<div id="slidemenubar2" style="left:-175" border="5" onMouseover="pull()" onMouseout="draw()">')
</script>
<layer id="slidemenubar" style="left:-185" border="5" onMouseOver="pull()" onMouseOut="draw()">
<a href="#" onMouseDown="javascript:imgRotate(1)" onMouseUp="javascript:imgRotate(0)">
<img src="News1.gif" height="50" width="200"></a>
<a href="#" onMouseDown="javascript:imgRotate2(3)" onMouseUp="javascript:imgRotate2(2)">
<img src="AdminButton1.gif" height="50" width="200"></a>
<a href="#" onMouseDown="javascript:imgRotate3(5)" onMouseUp="javascript:imgRotate3(4)">
<img src="Links1.gif" height="50" width="200"></a>
<a href="#" onMouseDown="javascript:imgRotate4(7)" onMouseUp="javascript:imgRotate4(6)">
<img src="Home1.gif" height="50" width="200"></a></layer>
<script language="JavaScript1.2">function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",400)
}
window.onload=regenerate2
if (document.all){
document.write('</div>')
themenu=document.all.slidemenubar2.style
rightboundary=0
leftboundary=-175
}
else{
themenu=document.layers.slidemenubar
rightboundary=170
leftboundary=10
}
function pull(){
if (window.drawit)
clearInterval(drawit)
pullit=setInterval("pullengine()",50)
}
function draw(){
clearInterval(pullit)
drawit=setInterval("drawengine()",30)
}
function pullengine(){
if (document.all&&themenu.pixelLeft<rightboundary)
themenu.pixelLeft+=25
else if(document.layers&&themenu.left<rightboundary)
themenu.left+=25
else if (window.pullit)
clearInterval(pullit)
}
function drawengine(){
if (document.all&&themenu.pixelLeft>leftboundary)
themenu.pixelLeft-=5
else if(document.layers&&themenu.left>leftboundary)
themenu.left-=5
else if (window.drawit)
clearInterval(drawit)
}
</script>
</body>
</html>
Now, here is my problem. When someone clicks on the graphical link, the imgRotate function is initiated. The problem is that the function rotates the image for the graphical link sitting under the one clicked. I'm still learning good/bad habits in javascript, so my script is sloppy. There is probably a way to use one function to call each of the images at the time needed. Any insight anyone can give is greatly apprectiated. I hope someone out there can help me.