Ok, this should be quite simple, but i cant get the code to work correctly at all, and its really making me very frustrated.
This code is for an image rollover, and as you can see it uses three different image names:
<body onLoad="slideit('slide','carImage',1)">
<img src=http://www.webdeveloper.com/forum/archive/index.php/"slide18.jpg" name="slide1"><br />
<img src="slide20.jpg" name="slide2"><br />
<img src="slide21.jpg" name="slide3">
<script language='javascript'>
<!--
var carImage1=new Image()
carImage1.src="slide18.jpg"
var carImage2=new Image()
carImage2.src="slide23.jpg"
var carImage3=new Image()
carImage3.src="slide20.jpg"
var carImage4=new Image()
carImage4.src="slide24.jpg"
var carImage5=new Image()
carImage5.src="slide21.jpg"
var carImage6=new Image()
carImage6.src="slide7.jpg"
function slideit(slideName, picName, numRollOvers)
{
var lenName = slideName.length;
var imgNum = numRollOvers;
var j = 0;
if (document.images)
{
with (document.images)
{
for (i = 0; i < length; i++)
{
if (document.images.name.substring(0,lenName) == slideName)
{
j++;
srcObj = eval(slideName + j) ;
srcObj.src = eval(picName + imgNum +".src");
imgNum+=2;
}
}
if (numRollOvers < 2) numRollOvers++
else numRollOvers = 1;
}
setTimeout("slideit('" + slideName + "','" + picName + "'," + numRollOvers + ")",1000);
}
}
//-->
</script>
I would like to incorporate this code into the other one, which just fades an image into focus over a period of time
<img src=http://www.webdeveloper.com/forum/archive/index.php/"slide18.jpg" name="fadeinimage" style="filter:alpha(opacity=0)">
<script language="JavaScript"><!--
function doFadeIn() {
if (document.fadeinimage.filters.alpha.opacity < 100) {
document.fadeinimage.filters.alpha.opacity=document.fadeinimage.filters.alpha.opacity+4
setTimeout("doFadeIn()",100)
}
}
doFadeIn()
// -->
</script>
Would appreciate some help on this
This code is for an image rollover, and as you can see it uses three different image names:
<body onLoad="slideit('slide','carImage',1)">
<img src=http://www.webdeveloper.com/forum/archive/index.php/"slide18.jpg" name="slide1"><br />
<img src="slide20.jpg" name="slide2"><br />
<img src="slide21.jpg" name="slide3">
<script language='javascript'>
<!--
var carImage1=new Image()
carImage1.src="slide18.jpg"
var carImage2=new Image()
carImage2.src="slide23.jpg"
var carImage3=new Image()
carImage3.src="slide20.jpg"
var carImage4=new Image()
carImage4.src="slide24.jpg"
var carImage5=new Image()
carImage5.src="slide21.jpg"
var carImage6=new Image()
carImage6.src="slide7.jpg"
function slideit(slideName, picName, numRollOvers)
{
var lenName = slideName.length;
var imgNum = numRollOvers;
var j = 0;
if (document.images)
{
with (document.images)
{
for (i = 0; i < length; i++)
{
if (document.images.name.substring(0,lenName) == slideName)
{
j++;
srcObj = eval(slideName + j) ;
srcObj.src = eval(picName + imgNum +".src");
imgNum+=2;
}
}
if (numRollOvers < 2) numRollOvers++
else numRollOvers = 1;
}
setTimeout("slideit('" + slideName + "','" + picName + "'," + numRollOvers + ")",1000);
}
}
//-->
</script>
I would like to incorporate this code into the other one, which just fades an image into focus over a period of time
<img src=http://www.webdeveloper.com/forum/archive/index.php/"slide18.jpg" name="fadeinimage" style="filter:alpha(opacity=0)">
<script language="JavaScript"><!--
function doFadeIn() {
if (document.fadeinimage.filters.alpha.opacity < 100) {
document.fadeinimage.filters.alpha.opacity=document.fadeinimage.filters.alpha.opacity+4
setTimeout("doFadeIn()",100)
}
}
doFadeIn()
// -->
</script>
Would appreciate some help on this