Hi,
I'm a perl/C programmer but a Javascript problem has been dumped into my
lap. A client of mine has a freeware javascript on their site which shows a
series of pictures on a web page in a conveyer belt fashion (I call it a
crawl). The script when running goes in the direction of right to left, they
would like it to go in the direction of right to left. There are no config
options at the head of this script to change it's direction. I've looked at
the code but nothing is jumping out at me that would solve this problem.
I've pasted the script in below. I'd really appreciate any advice or
solutions for this problem.
Thanks very much.
ms*****@optonli ne.net
------ Script ---
//Specify the slider's width (in pixels)
var sliderwidth="80 0px"
//Specify the slider's height
var sliderheight="1 40px"
//Specify the slider's slide speed (larger is faster 1-10)
var slidespeed=2
//configure background color:
slidebgcolor="# 4D88C0"
//Specify the slider's images
var leftrightslide= new Array()
var finalslide=''
leftrightslide[0]='<a href="" target="_blank" ><img src="go1.jpg"
border=0></a>'
leftrightslide[1]='<a href="" target="_blank" ><img src="go2.jpg"
border=0></a>'
leftrightslide[2]='<a href="" target="_blank" ><img src="go3.jpg"
border=0></a>'
leftrightslide[3]='<a href="" target="_blank" ><img src="go4.jpg"
border=0></a>'
leftrightslide[4]='<a href="" target="_blank" ><img src="go5.jpg"
border=0></a>'
leftrightslide[5]='<a href="" target="_blank" ><img src="go6.jpg"
border=0></a>'
leftrightslide[6]='<a href="" target="_blank" ><img src="go7.jpg"
border=0></a>'
leftrightslide[7]='<a href="" target="_blank" ><img src="go8.jpg"
border=0></a>'
leftrightslide[8]='<a href="" target="_blank" ><img src="go9.jpg"
border=0></a>'
leftrightslide[9]='<a href="" target="_blank" ><img src="go10.jpg"
border=0></a>'
////NO NEED TO EDIT BELOW THIS LINE////////////
var copyspeed=slide speed
leftrightslide= '<nobr>'+leftri ghtslide.join(" ")+'</nobr>'
var iedom=document. all||document.g etElementById
if (iedom)
document.write( '<span id="temp"
style="visibili ty:hidden;posit ion:absolute;to p:-100px;left:-9000px">'+leftr ightslide+'</span>')
var actualwidth=''
var cross_slide, ns_slide
function fillup(){
if (iedom){
cross_slide=doc ument.getElemen tById? document.getEle mentById("test2 ") :
document.all.te st2
cross_slide2=do cument.getEleme ntById? document.getEle mentById("test3 ") :
document.all.te st3
cross_slide.inn erHTML=cross_sl ide2.innerHTML= leftrightslide
actualwidth=doc ument.all? cross_slide.off setWidth :
document.getEle mentById("temp" ).offsetWidth
cross_slide2.st yle.left=actual width+20+"px"
}
else if (document.layer s){
ns_slide=docume nt.ns_slidemenu .document.ns_sl idemenu2
ns_slide2=docum ent.ns_slidemen u.document.ns_s lidemenu3
ns_slide.docume nt.write(leftri ghtslide)
ns_slide.docume nt.close()
actualwidth=ns_ slide.document. width
ns_slide2.left= actualwidth+20
ns_slide2.docum ent.write(leftr ightslide)
ns_slide2.docum ent.close()
}
lefttime=setInt erval("slidelef t()",30)
}
window.onload=f illup
function slideleft(){
if (iedom){
if (parseInt(cross _slide.style.le ft)>(actualwidt h*(-1)+8))
cross_slide.sty le.left=parseIn t(cross_slide.s tyle.left)-copyspeed+"px"
else
cross_slide.sty le.left=parseIn t(cross_slide2. style.left)+act ualwidth+30+"px "
if (parseInt(cross _slide2.style.l eft)>(actualwid th*(-1)+8))
cross_slide2.st yle.left=parseI nt(cross_slide2 .style.left)-copyspeed+"px"
else
cross_slide2.st yle.left=parseI nt(cross_slide. style.left)+act ualwidth+30+"px "
}
else if (document.layer s){
if (ns_slide.left> (actualwidth*(-1)+8))
ns_slide.left-=copyspeed
else
ns_slide.left=n s_slide2.left+a ctualwidth+30
if (ns_slide2.left >(actualwidth *(-1)+8))
ns_slide2.left-=copyspeed
else
ns_slide2.left= ns_slide.left+a ctualwidth+30
}
}
if (iedom||documen t.layers){
with (document){
document.write( '<table border="0" cellspacing="0" cellpadding="0" ><td>')
if (iedom){
write('<div
style="position :relative;width :'+sliderwidth+ ';height:'+slid erheight+';over flow:hidden">')
write('<div
style="position :absolute;width :'+sliderwidth+ ';height:'+slid erheight+';back ground-color:'+slidebg color+'"
onMouseover="co pyspeed=0" onMouseout="cop yspeed=slidespe ed">')
write('<div id="test2" style="position :absolute;left: 0px;top:0px"></div>')
write('<div id="test3"
style="position :absolute;left:-1000px;top:0px" ></div>')
write('</div></div>')
}
else if (document.layer s){
write('<ilayer width='+sliderw idth+' height='+slider height+'
name="ns_slidem enu" bgColor='+slide bgcolor+'>')
write('<layer name="ns_slidem enu2" left=0 top=0 onMouseover="co pyspeed=0"
onMouseout="cop yspeed=slidespe ed"></layer>')
write('<layer name="ns_slidem enu3" left=0 top=0 onMouseover="co pyspeed=0"
onMouseout="cop yspeed=slidespe ed"></layer>')
write('</ilayer>')
}
document.write( '</td></table>')
}
}
</script></td>