473,473 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

left - right horizontal scroller

Hi !
I have this part of code and i can not find out why the scroller is starting
from left to right instead RIGHT to LEFT.
This is the main part and the scroller is working fine but from the wrong
side.

//------------------------------------------
function
start(){if(document.getElementById){tdiv6=document .getElementById('slider');
firstns6();}
else if(document.all){tdivie=slider;firstie();}else
if(document.layers){tdivns4=document.slider1.docum ent.slider2;firstns4();}}
function
firstns4(){tdivns4.document.write('<nobr>'+imagef+ '</nobr>');tdivns4.documen
t.close();thel=tdivns4.document.width;tdivns4.left =-thel;slidens4();}
function
slidens4(){if(tdivns4.left<=swidth){tdivns4.left+= sspeed;setTimeout("slidens
4()",100);}else{tdivns4.left=-thel;slidens4();}}
function
firstie(){tdivie.innerHTML=('<nobr>'+imagef+'</nobr>');thel=tdivie.offsetWid
th;tdivie.style.pixelLeft=-thel;slideie();}
function
slideie(){if(tdivie.style.pixelLeft<=swidth){tdivi e.style.pixelLeft+=sspeed;
setTimeout("slideie()",100);}else{tdivie.style.pix elLeft=-thel;slideie();}}
function
firstns6(){tdiv6.innerHTML=('<nobr>'+imagef+'</nobr>');thel=tdiv6.offsetWidt
h;if(operbr!=-1){document.getElementById('opslider').innerHTML=' <nobr>'+imag
ef+'</nobr>';thel=document.getElementById('opslider').of fsetWidth;}tdiv6.sty
le.left=-thel;slidens6();}
function
slidens6(){if(parseInt(tdiv6.style.left)<=swidth){ tdiv6.style.left=parseInt(
tdiv6.style.left)+sspeed;setTimeout("slidens6()",1 00);}else{tdiv6.style.left
=-thel;slidens6();}}
//----------------------------------------------

If someone can find out why please let me know.
Thnx !
Jun 16 '06 #1
8 2354

marco wrote:
Hi !
I have this part of code and i can not find out why the scroller is starting
from left to right instead RIGHT to LEFT.
This is the main part and the scroller is working fine but from the wrong
side.

Can the same result (scrolling element) be accomplished in CSS?
Without seeing the code in action it's difficult to see exactly what
you're trying to achieve.

Jun 16 '06 #2
> Can the same result (scrolling element) be accomplished in CSS?
Without seeing the code in action it's difficult to see exactly what

you're trying to achieve.
*** I have ccs but just for colors and it has nothing to do with scroll. I
dont know if this can be done in ccs, but i think it can be done...

This is just like normal text/image scroller but from left to right. The
scroller repeat itself in endles loop.

O == simbol for image

----------------
O O O O O O
---------------
--->
Extended code:
//------------------------------------------------------------------
for(mi=leftimage.length-1;mi>=0;mi--)
imagef=imagef+leftimage[mi];

var
operbr=navigator.userAgent.toLowerCase().indexOf(' opera');if(operbr==-1&&nav
igator.product&&navigator.product=="Gecko"){var agt =
navigator.userAgent.toLowerCase();var rvStart = agt.indexOf('rv:');var rvEnd
= agt.indexOf(')', rvStart);var check15 = agt.substring(rvStart+3,
rvEnd);if(parseFloat(check15)>=1.8)
operbr=0;}if(navigator.appVersion.indexOf("Mac")!=-1)operbr=0;

function goup(){if(sspeed!=rspeed*8){sspeed=sspeed*2;restar t=sspeed;}}

function
start(){if(document.getElementById){tdiv6=document .getElementById('slider');
firstns6();}
else if(document.all){tdivie=slider;firstie();}else
if(document.layers){tdivns4=document.slider1.docum ent.slider2;firstns4();}}
function
firstns4(){tdivns4.document.write('<nobr>'+imagef+ '</nobr>');tdivns4.documen
t.close();thel=tdivns4.document.width;tdivns4.left =-thel;slidens4();}
function
slidens4(){if(tdivns4.left<=swidth){tdivns4.left+= sspeed;setTimeout("slidens
4()",100);}else{tdivns4.left=-thel;slidens4();}}
function
firstie(){tdivie.innerHTML=('<nobr>'+imagef+'</nobr>');thel=tdivie.offsetWid
th;tdivie.style.pixelLeft=-thel;slideie();}
function
slideie(){if(tdivie.style.pixelLeft<=swidth){tdivi e.style.pixelLeft+=sspeed;
setTimeout("slideie()",100);}else{tdivie.style.pix elLeft=-thel;slideie();}}
function
firstns6(){tdiv6.innerHTML=('<nobr>'+imagef+'</nobr>');thel=tdiv6.offsetWidt
h;if(operbr!=-1){document.getElementById('opslider').innerHTML=' <nobr>'+imag
ef+'</nobr>';thel=document.getElementById('opslider').of fsetWidth;}tdiv6.sty
le.left=-thel;slidens6();}
function
slidens6(){if(parseInt(tdiv6.style.left)<=swidth){ tdiv6.style.left=parseInt(
tdiv6.style.left)+sspeed;setTimeout("slidens6()",1 00);}else{tdiv6.style.left
=-thel;slidens6();}}
</SCRIPT>
Jun 16 '06 #3
marco said the following on 6/16/2006 1:14 PM:
Can the same result (scrolling element) be accomplished in CSS?
Without seeing the code in action it's difficult to see exactly what

you're trying to achieve.
*** I have ccs but just for colors and it has nothing to do with scroll. I
dont know if this can be done in ccs, but i think it can be done...

This is just like normal text/image scroller but from left to right. The
scroller repeat itself in endles loop.

O == simbol for image

----------------
O O O O O O
---------------
--->
Extended code:
//------------------------------------------------------------------
for(mi=leftimage.length-1;mi>=0;mi--)
imagef=imagef+leftimage[mi];

var operbr=navigator.userAgent.toLowerCase().indexOf(' opera');


That one line of code points to 99% of your problems.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 16 '06 #4
> > var operbr=navigator.userAgent.toLowerCase().indexOf(' opera');
That one line of code points to 99% of your problems.

*** Hmmm.....
How can i fix this ? I want to use this scroller on firefox and on
iexplorer.
I have try the code with firefox and with iexplorer but direction is the
same : -->
So, basicly, i have no idea how to correct this....
Jun 17 '06 #5
any idea, guys ?
I still dont get it why is this going in wrong direction...
Jun 19 '06 #6
This is the "same" example but with right direction...
http://www.siemens.com/index.jsp?sdc...l1s2mn1033035u
Jun 19 '06 #7

marco wrote:
var operbr=navigator.userAgent.toLowerCase().indexOf(' opera');

That one line of code points to 99% of your problems.

*** Hmmm.....
How can i fix this ? I want to use this scroller on firefox and on
iexplorer.
I have try the code with firefox and with iexplorer but direction is the
same : -->
So, basicly, i have no idea how to correct this....


I think purely from a programming point of view you need to dig deep
into firefox and iexplorer to find out what their instructions for such
an effect would be, but preferably see if there's a generic procedure
that works on all browsers. Go to their prospective development sites
and see what you can find - I don't know for iexplorer how much will be
available to the general public, but Mozilla should be completely open
about their functions etc. The best solution will be one that does not
rely on browser detection.

Jun 20 '06 #8

marco wrote:
This is the "same" example but with right direction...
http://www.siemens.com/index.jsp?sdc...l1s2mn1033035u


This slows my machine to a crawl, I would leave such a site very
quickly. Bare that in mind when designing web pages.

Jun 20 '06 #9

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

Similar topics

10
by: Anders Wegge Jakobsen | last post by:
Hi, I'm playing around with a layout for a weblog. A mockup can be seen at <http://outside.bakkelygaard.dk/~wegge/testblog/index.html>. The page has a fixed width of 800px, so I'm perfectly...
4
by: Harlan Messinger | last post by:
What is *supposed* to be the way to specify the horizontal offset of (a) the list item's marker and (b) the list item's content? In particular, see ...
4
by: Generale Cluster | last post by:
Hello, where can I find an horizontal scroller where I can set the scrolling direction from left to right? Thank you -- elimina unsampdoriano per rispondere via email
3
by: Alex D. | last post by:
does any body knows about some horizontal news scrollers that supports relative position or that resizes automatically to fit the whole horizontal space when viewed in different resolutions? ...
0
by: =?Utf-8?B?QmlzaG95?= | last post by:
Hi All, I have a Right to Left web page with asp.net 2.0 containing a horizontal menu. The menu is right to left as the page. The problem is the submenu items or the dynamic menu items are...
3
by: lolo | last post by:
hello. happy new year. I'm trying to build a website for my wife and she is adament on having a horizontal thumbnail scrolling div. great. I have a good vertical scrolling thing, but can't...
5
by: OtisUsenet | last post by:
Hi, I'm killing myself trying to get a "horizontal nav bar" where some text is left aligned, and some is aligned to the right, kind of like this: LEFT ...
2
by: Steve | last post by:
Hi All I want to prevent the Windows Tabcontrol from showing the horizontal scroll bar when the Number of Tabs exceeds the width of the control I use code in 2 buttons to control the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.