473,750 Members | 2,414 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Conveyer Belt Image Script question -- other direction

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>
Jul 23 '05 #1
5 1368
Milagro wrote:
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.
<--snip-->
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"


That -copyspeed is what sets the left style, meaning its moving it to
the left. Changing it to + instead of - should make it move the other
direction.

You will have to keep hunting the +/- "px" and tinker with it to find
them all. Change one, see what effect it has.
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
"Randy Webb" <Hi************ @aol.com> wrote in message
news:et******** ************@co mcast.com...
Milagro wrote:
Hi,

I'm a perl/C programmer but a Javascript problem has been dumped into
my

< snip>
<--snip-->
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"


That -copyspeed is what sets the left style, meaning its moving it to
the left. Changing it to + instead of - should make it move the other
direction.

You will have to keep hunting the +/- "px" and tinker with it to find
them all. Change one, see what effect it has.


the "px" is the (required) unit qualifier in CSS position attributes:

.crossSlideStyl e {
left: 100px;
top: 50px;
}

It could have been "em", "in", etc...

--
Dag
58°26'15.9" N 008°46'45.5" E
Jul 23 '05 #3
Dag Sunde wrote:
"Randy Webb" <Hi************ @aol.com> wrote in message
news:et******** ************@co mcast.com...
Milagro wrote:
Hi,

I'm a perl/C programmer but a Javascript problem has been dumped into


my

< snip>
<--snip-->
function slideleft(){
if (iedom){
if (parseInt(cross _slide.style.le ft)>(actualwidt h*(-1)+8))
cross_slide. style.left=pars eInt(cross_slid e.style.left)-copyspeed+"px"


That -copyspeed is what sets the left style, meaning its moving it to
the left. Changing it to + instead of - should make it move the other
direction.

You will have to keep hunting the +/- "px" and tinker with it to find
them all. Change one, see what effect it has.

the "px" is the (required) unit qualifier in CSS position attributes:

.crossSlideStyl e {
left: 100px;
top: 50px;
}

It could have been "em", "in", etc...


I totally understand and know that. The line before that one says
"Changing it to + instead of -.....", the "px" part is what is going to
give a clue as to which *ones* to change. If you change all the + to -,
it will break the script.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #4
"Randy Webb" <Hi************ @aol.com> wrote in message
news:-s************** ******@comcast. com...
Dag Sunde wrote:
"Randy Webb" <Hi************ @aol.com> wrote in message
news:et******** ************@co mcast.com...
Milagro wrote:

Hi,

I'm a perl/C programmer but a Javascript problem has been dumped into
my

< snip>
<--snip-->

function slideleft(){
if (iedom){
if (parseInt(cross _slide.style.le ft)>(actualwidt h*(-1)+8))
cross_slide. style.left=pars eInt(cross_slid e.style.left)-copyspeed+"px"

That -copyspeed is what sets the left style, meaning its moving it to
the left. Changing it to + instead of - should make it move the other
direction.

You will have to keep hunting the +/- "px" and tinker with it to find
them all. Change one, see what effect it has.

the "px" is the (required) unit qualifier in CSS position attributes:

<snipped>
I totally understand and know that. The line before that one says
"Changing it to + instead of -.....", the "px" part is what is going to
give a clue as to which *ones* to change. If you change all the + to -,
it will break the script.

My bad, then...
I thought you meant change + "px" into - "px"...
:-)

--
Dag
58°26'15.9" N 008°46'45.5" E
Jul 23 '05 #5
> > >>
>>function slideleft(){
>>if (iedom){
>>if (parseInt(cross _slide.style.le ft)>(actualwidt h*(-1)+8))
>>cross_slide. style.left=pars eInt(cross_slid e.style.left)-copyspeed+"px"
>
>That -copyspeed is what sets the left style, meaning its moving it to
>the left. Changing it to + instead of - should make it move the other
>direction.
>
>You will have to keep hunting the +/- "px" and tinker with it to find
>them all. Change one, see what effect it has.


Hi,
I've tried to change the values mentioned above and it does work, but
it also causes the images to scroll off the right side of the page and
not recycle themselves as they had before. I've tried changing all of
the style.left lines to style.right but that didn't work. It only
froze the scrolling all together.
Does anyone have any suggestions on how to fix this new problem I'm
having with this script? Thanks very much.

Mike
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2533
by: Michel | last post by:
Hi folks, I wonder if what I have in mind is possible, maybe even not all that complicated: I have an image, which is a yellow circle. I want this yellow circle to change color by having 3 sliders (RGB) on a website and a button to process it. Is this at all possible and could someone point me in the right direction or
2
2107
by: | last post by:
I am hoping a mixed ASP- Javascript programmer could help me with this scenario: I have a list box populated with randomized records (NewID()) from a Broker (Salesperson) sql server table. Each time the user selects one of the broker items I need to display a Image of the broker in the table cell next to it. I have found a number of online js scripts that use the image selector route
3
1765
by: Andy | last post by:
Can someone please help me with this problem? I don't know if this is possible in Java, so if it's not please point me in the right direction or to the right newsgroup! (I'm a newby to Java scripting). On a web page I have a webcam type image that updates every minute. I wish to conditionally replace this image with an apology image in the event that my upload fails for more than an hour. I guess what I want is some script that will...
12
2747
by: Major Man | last post by:
Hi, I have this .jpg picture that's 700 x 200. What I wanna do is display it on a 300 x 200 window, and have it scroll left and right, back and forth. Can anyone help this newbie? TIA
6
22133
by: ruca | last post by:
Hi gurus, I have a imagebutton in my WebForm, and I want that when I click (mouse down) on her the imagebutton change image and when I "unclick" (mouse up) change to the original image. Basically I want to know how can I have the mousedown and mouseup buttons events. I think that I have to do this in JavaScript. Can you help me on this?
1
1588
by: NH | last post by:
Hi, I'm struggling to display an image on asp.net webform (vb.net). The image is stored in a image field in a sql server database. I have read a good few solutions to it and still havnt got it working for the last 2 days. Heres my code...
0
8839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9397
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9344
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9257
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8264
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4716
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.