krautinator
10-28-2003, 12:04 PM
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT language="JavaScript">
<!--
function moveit(newspot)
{
if (document.layers)
{
var picture=document.image1;
if (newspot<500)
{
picture.left= newspot;
newspot+=30;
setTimeout('moveit('+newspot+')',20);
}
}
if (document.all)
{
var picture=document.all.image1.style;
if (newspot<500)
{
picture.left= newspot;
newspot+=30;
setTimeout('moveit('+newspot+')',20);
}
}
}
function moveitback(newspot)
{
if (document.layers)
{
var picture=document.image1;
if (newspot<500)
{
picture.left = newspot;
newspot-=30;
setTimeout('moveit('+newspot+')',20);
}
}
if (document.all)
{
var picture=document.all.image1.style;
if (newspot<500)
{
picture.left= newspot;
newspot-=30;
setTimeout('moveitback('+newspot+')',20);
}
}
}
//-->
</SCRIPT>
<STYLE type="text/css">
<!--
.moveimage { position:absolute; left:200px; top:10px; z-index:2;filter:alpha(opacity=40) }
-->
</STYLE>
</HEAD>
<BODY background="rain.jpg">
<DIV ID="image1" class="moveimage">
<IMG SRC="rain.jpg">
</DIV>
<img src="drop0.jpg" onmouseover="moveit(200)" onmouseout="moveitback(200)" >
</BODY>
</HTML>
I think the problem is somewhere within the highlighted text, but I'm not sure what it is...
the script is supposed to move an image right a certain amount, and then move back to it's original position,
it moves it right, but then when it tries to move back to the original position, the image keeps going left into infinity...:eek:
???
any ideaz?:confused:
<HEAD>
<TITLE></TITLE>
<SCRIPT language="JavaScript">
<!--
function moveit(newspot)
{
if (document.layers)
{
var picture=document.image1;
if (newspot<500)
{
picture.left= newspot;
newspot+=30;
setTimeout('moveit('+newspot+')',20);
}
}
if (document.all)
{
var picture=document.all.image1.style;
if (newspot<500)
{
picture.left= newspot;
newspot+=30;
setTimeout('moveit('+newspot+')',20);
}
}
}
function moveitback(newspot)
{
if (document.layers)
{
var picture=document.image1;
if (newspot<500)
{
picture.left = newspot;
newspot-=30;
setTimeout('moveit('+newspot+')',20);
}
}
if (document.all)
{
var picture=document.all.image1.style;
if (newspot<500)
{
picture.left= newspot;
newspot-=30;
setTimeout('moveitback('+newspot+')',20);
}
}
}
//-->
</SCRIPT>
<STYLE type="text/css">
<!--
.moveimage { position:absolute; left:200px; top:10px; z-index:2;filter:alpha(opacity=40) }
-->
</STYLE>
</HEAD>
<BODY background="rain.jpg">
<DIV ID="image1" class="moveimage">
<IMG SRC="rain.jpg">
</DIV>
<img src="drop0.jpg" onmouseover="moveit(200)" onmouseout="moveitback(200)" >
</BODY>
</HTML>
I think the problem is somewhere within the highlighted text, but I'm not sure what it is...
the script is supposed to move an image right a certain amount, and then move back to it's original position,
it moves it right, but then when it tries to move back to the original position, the image keeps going left into infinity...:eek:
???
any ideaz?:confused: