An impressive single line news ticker with smooth scrolling motion. Supports any valid HTML within the scroll text, including images or links. Really easy to position on your page, just place the "tickpos" anchor where you want the scroller to appear.
Doesn't this message scroller look great? You can even insert links like this: JavaScript Editor Now it repeats.
Add the below code to the <body> section of your page:
<scriptlanguage="javascript"type="text/javascript"> /* Visit http://www.yaldex.com/
for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin var
l1 =0;// left of ticker in pixel, or 0
to position relative var
t1 =0;// top of ticker in pixel, or 0
to position relative var
w1 =400;// width of ticker in pixel var
first =true; var
l2 =
l1 +
w1; var
l3 =
l1 -
l2; var
l =
l2; function
tickinit(){ if(l1
==0&&
t1 ==0){ pos =document.all['tickpos']; l1 =
getLeft(pos); t1 =
getTop(pos);
} ticktext.style.posTop=
t1;
l2 =
l1 +
w1; l3 =
l1 -
l2; l =
l2; setInterval('tick()',10);
} function
getLeft(ll){ if(ll.offsetParent) return(ll.offsetLeft+
getLeft(ll.offsetParent)); else
return(ll.offsetLeft);
} function
getTop(ll){ if(ll.offsetParent) return(ll.offsetTop+
getTop(ll.offsetParent)); else
return(ll.offsetTop);
} function
tick(){ l =
l -0.5; if(l
<
l3)
l =
l2; cl =
l1 -
l; cr =
l2 -
l; ticktext.style.posLeft=
l; ticktext.style.posTop=
t1; ticktext.style.clip="rect(auto "+cr+"px
auto "+cl+"px)"; if(first)
ticktext.style.visibility="visible"; first =false;
} window.onload=tickinit; // End --> </script> <center> <aname="tickpos"></a> <divid="ticktext"style="position:absolute;font-family:arial;font-size:14pt;visibility:hidden;">
<nobr>Doesn't
this message scroller look great? You can even insert links like this:
<ahref="http://www.yaldex.com/JSFactory_Pro.htm"target="_blank">JavaScript
Editor</a>
Now it repeats.</nobr>
</div>
</center>