Shark
Posts: 2 Joined: 11/27/2004 Status: offline
|
2 identical javascripts on 1 page - 11/27/2004 0:18:12
Hello, I am familiar with post 3209. I tried to replicate the technique with a different script with no luck. Here is the original script that works: <script language="JavaScript1.2">
/*
Left-Right image slideshow Script-
By Dynamic Drive (www.dynamicdrive.com)
For full source code, terms of use, and 100's more scripts, visit http://dynamicdrive.com
*/
///////configure the below four variables to change the style of the slider///////
//set the scrollerwidth and scrollerheight to the width/height of the LARGEST image in your slideshow!
var scrollerwidth='166px'
var scrollerheight='163px'
var scrollerbgcolor='white'
//4000 miliseconds=4 seconds
var pausebetweenimages=4000
//configure the below variable to change the images used in the slideshow. If you wish the images to be clickable, simply wrap the images with the appropriate <a> tag
var slideimages=new Array()
slideimages[0]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=21"><img src="http://69.20.90.77/ProductImages/HandheldGPS/GPSMAP60CSIcon.jpg" border=0"></a>'
slideimages[1]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=20"><img src="http://69.20.90.77/ProductImages/HandheldGPS/GPSMAP60CIcon.jpg" border=0"></a>'
slideimages[2]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=39"><img src="http://69.20.90.77/ProductImages/HandheldGPS/megellanMeridianMarineThumb.jpg" border=0"></a>'
slideimages[3]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=37"><img src="http://69.20.90.77/ProductImages/HandheldGPS/MagellanSportrakColorGPSthumb.jpg" border=0"></a>'
slideimages[4]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=22"><img src="http://69.20.90.77/ProductImages/HandheldGPS/rino110thumb.jpg" border=0"></a>'
//extend this list
///////Do not edit pass this line///////////////////////
var ie=document.all
var dom=document.getElementById
if (slideimages.length>1)
i=2
else
i=0
function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.left>0&&tlayer.left<=5){
tlayer.left=0
setTimeout("move1(tlayer)",pausebetweenimages)
setTimeout("move2(document.main.document.second)",pausebetweenimages)
return
}
if (tlayer.left>=tlayer.document.width*-1){
tlayer.left-=5
setTimeout("move1(tlayer)",50)
}
else{
tlayer.left=parseInt(scrollerwidth)+5
tlayer.document.write(slideimages)
tlayer.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.left>0&&tlayer2.left<=5){
tlayer2.left=0
setTimeout("move2(tlayer2)",pausebetweenimages)
setTimeout("move1(document.main.document.first)",pausebetweenimages)
return
}
if (tlayer2.left>=tlayer2.document.width*-1){
tlayer2.left-=5
setTimeout("move2(tlayer2)",50)
}
else{
tlayer2.left=parseInt(scrollerwidth)+5
tlayer2.document.write(slideimages)
tlayer2.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move3(whichdiv){
tdiv=eval(whichdiv)
if (parseInt(tdiv.style.left)>0&&parseInt(tdiv.style.left)<=5){
tdiv.style.left=0+"px"
setTimeout("move3(tdiv)",pausebetweenimages)
setTimeout("move4(scrollerdiv2)",pausebetweenimages)
return
}
if (parseInt(tdiv.style.left)>=tdiv.offsetWidth*-1){
tdiv.style.left=parseInt(tdiv.style.left)-5+"px"
setTimeout("move3(tdiv)",50)
}
else{
tdiv.style.left=scrollerwidth
tdiv.innerHTML=slideimages
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv)
if (parseInt(tdiv2.style.left)>0&&parseInt(tdiv2.style.left)<=5){
tdiv2.style.left=0+"px"
setTimeout("move4(tdiv2)",pausebetweenimages)
setTimeout("move3(scrollerdiv1)",pausebetweenimages)
return
}
if (parseInt(tdiv2.style.left)>=tdiv2.offsetWidth*-1){
tdiv2.style.left=parseInt(tdiv2.style.left)-5+"px"
setTimeout("move4(scrollerdiv2)",50)
}
else{
tdiv2.style.left=scrollerwidth
tdiv2.innerHTML=slideimages
if (i==slideimages.length-1)
i=0
else
i++
}
}
function startscroll(){
if (ie||dom){
scrollerdiv1=ie? first2 : document.getElementById("first2")
scrollerdiv2=ie? second2 : document.getElementById("second2")
move3(scrollerdiv1)
scrollerdiv2.style.left=scrollerwidth
}
else if (document.layers){
document.main.visibility='show'
move1(document.main.document.first)
document.main.document.second.left=parseInt(scrollerwidth)+5
document.main.document.second.visibility='show'
}
}
window.onload=startscroll
</script>
<ilayer id="main" width="&{scrollerwidth};"
height="&{scrollerheight};" bgcolor="&{scrollerbgcolor};"
visibility="hide"><layer id="first" left="1" top="0"
width="&{scrollerwidth};">
<script language="JavaScript1.2">
if (document.layers)
document.write(slideimages[0])
</script></layer>
<layer id="second" left="0" top="0" width="&{scrollerwidth};"
visibility="hide">
<script language="JavaScript1.2">
if (document.layers)
document.write(slideimages[1])
</script></layer>
</ilayer>
<script language="JavaScript1.2">
if (ie||dom){
document.writeln('<div id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;background-color:'+scrollerbgcolor+'">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:1px;top:0px;">')
document.write(slideimages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px">')
document.write(slideimages[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</div>')
}
</script> _____________________________________________________________________________________________________________________________________ Here is what I did: <html>
<head>
<SCRIPT LANGUAGE="JavaScript" src="http://69.20.90.77/ProductImages/script/ss1.js">
<SCRIPT LANGUAGE="JavaScript" src="http://69.20.90.77/ProductImages/script/ss2.js">
</Script>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title></title>
</head>
<body>
<body onLoad="runmove0(), runmove1(),runmove2(), runmove3(), runmove4()">
<table style="width: 100%; text-align: left;" border="1" cellpadding="2"
cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top; name="move0"> <br>
<br>
<br>
<br>
<br>
</td>
<td style="vertical-align: top; name="move0"><br>
</td>
</tr>
</tbody>
</table>
<br>
</body>
</html>
___________________________________________________________________________________________________
ss1.js:
/*
Left-Right image slideshow Script-
By Dynamic Drive (www.dynamicdrive.com)
For full source code, terms of use, and 100's more scripts, visit http://dynamicdrive.com
*/
///////configure the below four variables to change the style of the slider///////
//set the scrollerwidth and scrollerheight to the width/height of the LARGEST image in your slideshow!
var scrollerwidth='166px'
var scrollerheight='163px'
var scrollerbgcolor='white'
//4000 miliseconds=4 seconds
var pausebetweenimages=4000
//configure the below variable to change the images used in the slideshow. If you wish the images to be clickable, simply wrap the images with the appropriate <a> tag
var slideimages=new Array()
slideimages[0]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=21"><img src="http://69.20.90.77/ProductImages/HandheldGPS/GPSMAP60CSIcon.jpg" border=0"></a>'
slideimages[1]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=20"><img src="http://69.20.90.77/ProductImages/HandheldGPS/GPSMAP60CIcon.jpg" border=0"></a>'
slideimages[2]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=39"><img src="http://69.20.90.77/ProductImages/HandheldGPS/megellanMeridianMarineThumb.jpg" border=0"></a>'
slideimages[3]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=37"><img src="http://69.20.90.77/ProductImages/HandheldGPS/MagellanSportrakColorGPSthumb.jpg" border=0"></a>'
slideimages[4]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=22"><img src="http://69.20.90.77/ProductImages/HandheldGPS/rino110thumb.jpg" border=0"></a>'
//extend this list
///////Do not edit pass this line///////////////////////
var ie=document.all
var dom=document.getElementById
if (slideimages.length>1)
i=2
else
i=0
function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.left>0&&tlayer.left<=5){
tlayer.left=0
setTimeout("move1(tlayer)",pausebetweenimages)
setTimeout("move2(document.main.document.second)",pausebetweenimages)
return
}
if (tlayer.left>=tlayer.document.width*-1){
tlayer.left-=5
setTimeout("move1(tlayer)",50)
}
else{
tlayer.left=parseInt(scrollerwidth)+5
tlayer.document.write(slideimages)
tlayer.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.left>0&&tlayer2.left<=5){
tlayer2.left=0
setTimeout("move2(tlayer2)",pausebetweenimages)
setTimeout("move1(document.main.document.first)",pausebetweenimages)
return
}
if (tlayer2.left>=tlayer2.document.width*-1){
tlayer2.left-=5
setTimeout("move2(tlayer2)",50)
}
else{
tlayer2.left=parseInt(scrollerwidth)+5
tlayer2.document.write(slideimages)
tlayer2.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move3(whichdiv){
tdiv=eval(whichdiv)
if (parseInt(tdiv.style.left)>0&&parseInt(tdiv.style.left)<=5){
tdiv.style.left=0+"px"
setTimeout("move3(tdiv)",pausebetweenimages)
setTimeout("move4(scrollerdiv2)",pausebetweenimages)
return
}
if (parseInt(tdiv.style.left)>=tdiv.offsetWidth*-1){
tdiv.style.left=parseInt(tdiv.style.left)-5+"px"
setTimeout("move3(tdiv)",50)
}
else{
tdiv.style.left=scrollerwidth
tdiv.innerHTML=slideimages
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv)
if (parseInt(tdiv2.style.left)>0&&parseInt(tdiv2.style.left)<=5){
tdiv2.style.left=0+"px"
setTimeout("move4(tdiv2)",pausebetweenimages)
setTimeout("move3(scrollerdiv1)",pausebetweenimages)
return
}
if (parseInt(tdiv2.style.left)>=tdiv2.offsetWidth*-1){
tdiv2.style.left=parseInt(tdiv2.style.left)-5+"px"
setTimeout("move4(scrollerdiv2)",50)
}
else{
tdiv2.style.left=scrollerwidth
tdiv2.innerHTML=slideimages
if (i==slideimages.length-1)
i=0
else
i++
}
}
function startscroll(){
if (ie||dom){
scrollerdiv1=ie? first2 : document.getElementById("first2")
scrollerdiv2=ie? second2 : document.getElementById("second2")
move3(scrollerdiv1)
scrollerdiv2.style.left=scrollerwidth
}
else if (document.layers){
document.main.visibility='show'
move1(document.main.document.first)
document.main.document.second.left=parseInt(scrollerwidth)+5
document.main.document.second.visibility='show'
}
}
window.onload=startscroll
<ilayer id="main" width="&{scrollerwidth};"
height="&{scrollerheight};" bgcolor="&{scrollerbgcolor};"
visibility="hide"><layer id="first" left="1" top="0"
width="&{scrollerwidth};">
if (document.layers)
document.write(slideimages[0])
</layer>
<layer id="second" left="0" top="0" width="&{scrollerwidth};"
visibility="hide">
if (document.layers)
document.write(slideimages[1])
</layer>
</ilayer>
if (ie||dom){
document.writeln('<div id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;background-color:'+scrollerbgcolor+'">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:1px;top:0px;">')
document.write(slideimages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px">')
document.write(slideimages[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</div>')
}
_____________________________________________________________________________________________________________________________________
ss2.js
/*
Left-Right image slideshow Script-
By Dynamic Drive (www.dynamicdrive.com)
For full source code, terms of use, and 100's more scripts, visit http://dynamicdrive.com
*/
///////configure the below four variables to change the style of the slider///////
//set the scrollerwidth and scrollerheight to the width/height of the LARGEST image in your slideshow!
var scrollerwidth='166px'
var scrollerheight='163px'
var scrollerbgcolor='white'
//4000 miliseconds=4 seconds
var pausebetweenimages=4000
//configure the below variable to change the images used in the slideshow. If you wish the images to be clickable, simply wrap the images with the appropriate <a> tag
var slideimages=new Array()
slideimages[0]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=21"><img src="http://69.20.90.77/ProductImages/HandheldGPS/GPSMAP60CSIcon.jpg" border=0"></a>'
slideimages[1]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=20"><img src="http://69.20.90.77/ProductImages/HandheldGPS/GPSMAP60CIcon.jpg" border=0"></a>'
slideimages[2]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=39"><img src="http://69.20.90.77/ProductImages/HandheldGPS/megellanMeridianMarineThumb.jpg" border=0"></a>'
slideimages[3]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=37"><img src="http://69.20.90.77/ProductImages/HandheldGPS/MagellanSportrakColorGPSthumb.jpg" border=0"></a>'
slideimages[4]='<a href="http://69.20.90.77/index.asp?PageAction=VIEWPROD&ProdID=22"><img src="http://69.20.90.77/ProductImages/HandheldGPS/rino110thumb.jpg" border=0"></a>'
//extend this list
///////Do not edit pass this line///////////////////////
var ie=document.all
var dom=document.getElementById
if (slideimages.length>1)
i=2
else
i=0
function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.left>0&&tlayer.left<=5){
tlayer.left=0
setTimeout("move1(tlayer)",pausebetweenimages)
setTimeout("move2(document.main.document.second)",pausebetweenimages)
return
}
if (tlayer.left>=tlayer.document.width*-1){
tlayer.left-=5
setTimeout("move1(tlayer)",50)
}
else{
tlayer.left=parseInt(scrollerwidth)+5
tlayer.document.write(slideimages)
tlayer.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.left>0&&tlayer2.left<=5){
tlayer2.left=0
setTimeout("move2(tlayer2)",pausebetweenimages)
setTimeout("move1(document.main.document.first)",pausebetweenimages)
return
}
if (tlayer2.left>=tlayer2.document.width*-1){
tlayer2.left-=5
setTimeout("move2(tlayer2)",50)
}
else{
tlayer2.left=parseInt(scrollerwidth)+5
tlayer2.document.write(slideimages)
tlayer2.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move3(whichdiv){
tdiv=eval(whichdiv)
if (parseInt(tdiv.style.left)>0&&parseInt(tdiv.style.left)<=5){
tdiv.style.left=0+"px"
setTimeout("move3(tdiv)",pausebetweenimages)
setTimeout("move4(scrollerdiv2)",pausebetweenimages)
return
}
if (parseInt(tdiv.style.left)>=tdiv.offsetWidth*-1){
tdiv.style.left=parseInt(tdiv.style.left)-5+"px"
setTimeout("move3(tdiv)",50)
}
else{
tdiv.style.left=scrollerwidth
tdiv.innerHTML=slideimages
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv)
if (parseInt(tdiv2.style.left)>0&&parseInt(tdiv2.style.left)<=5){
tdiv2.style.left=0+"px"
setTimeout("move4(tdiv2)",pausebetweenimages)
setTimeout("move3(scrollerdiv1)",pausebetweenimages)
return
}
if (parseInt(tdiv2.style.left)>=tdiv2.offsetWidth*-1){
tdiv2.style.left=parseInt(tdiv2.style.left)-5+"px"
setTimeout("move4(scrollerdiv2)",50)
}
else{
tdiv2.style.left=scrollerwidth
tdiv2.innerHTML=slideimages
if (i==slideimages.length-1)
i=0
else
i++
}
}
function startscroll(){
if (ie||dom){
scrollerdiv1=ie? first2 : document.getElementById("first2")
scrollerdiv2=ie? second2 : document.getElementById("second2")
move3(scrollerdiv1)
scrollerdiv2.style.left=scrollerwidth
}
else if (document.layers){
document.main.visibility='show'
move1(document.main.document.first)
document.main.document.second.left=parseInt(scrollerwidth)+5
document.main.document.second.visibility='show'
}
}
window.onload=startscroll
<ilayer id="main" width="&{scrollerwidth};"
height="&{scrollerheight};" bgcolor="&{scrollerbgcolor};"
visibility="hide"><layer id="first" left="1" top="0"
width="&{scrollerwidth};">
if (document.layers)
document.write(slideimages[0])
</layer>
<layer id="second" left="0" top="0" width="&{scrollerwidth};"
visibility="hide">
if (document.layers)
document.write(slideimages[1])
</layer>
</ilayer>
if (ie||dom){
document.writeln('<div id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;background-color:'+scrollerbgcolor+'">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:1px;top:0px;">')
document.write(slideimages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px">')
document.write(slideimages[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</div>')
}
___________________________________________________________________________________________________________________________________ This is not working, can someone help?
< Message edited by Spooky -- 11/27/2004 13:18:13 >
|