views:

8461

answers:

2

I'm hopeless at Javascript. This is what I have:

<script type="text/javascript">
function beginrefresh(){
var marquee=document.getElementById("marquee_text");//set the id of the target object
if(marquee.scrollLeft>=marquee.scrollWidth-parseInt(marquee.style.width))marquee.scrollLeft=0;
marquee.scrollLeft+=1;
setTimeout("beginrefresh()",10);//set the delay (ms), bigger delay, slower movement
}
</script>

It scrolls to the left but I need it to repeat relatively seamlessly. At the moment it just jumps back to the beginning. It might not be possible the way I've done it, if not, anyone have a better method?

A: 

A simple google search and you find exactly what your looking for:

http://javascript.about.com/library/bltick2.htm

Sander Versluys
+5  A: 

Here's a jquery plugin with a lot of features:

http://jscroller2.markusbordihn.de/example/image-scroller-windiv/

And this one is "silkly smooth"

http://remysharp.com/2008/09/10/the-silky-smooth-marquee/

GeekyMonkey