Hi,
I have created a javascript file and separate HTML file to make a scrolling news bar for the karting website which I maintain. I have made the javascript bar scroll without any problems, but I am having difficulties making it keep on scrolling. I have tried using the reload function but that stops it scrolling all together.
Javascript Code
var pos=100;
function Scroll() {
if (!document.getElementById) return;
obj=document.getElementById("thetext");
pos -=1;
if (pos < 0-obj.offsetHeight+130) return;
obj.style.top=pos;
window.setTimeout("Scroll();",30);
}
The html file uses the body onload function to call the javascript, and then the text contained within in its entered through a number of div's.
Any help would be much appreciated.
Thanks
Pete
I have created a javascript file and separate HTML file to make a scrolling news bar for the karting website which I maintain. I have made the javascript bar scroll without any problems, but I am having difficulties making it keep on scrolling. I have tried using the reload function but that stops it scrolling all together.
Javascript Code
var pos=100;
function Scroll() {
if (!document.getElementById) return;
obj=document.getElementById("thetext");
pos -=1;
if (pos < 0-obj.offsetHeight+130) return;
obj.style.top=pos;
window.setTimeout("Scroll();",30);
}
The html file uses the body onload function to call the javascript, and then the text contained within in its entered through a number of div's.
Any help would be much appreciated.
Thanks
Pete