colinramsay.co.uk

A Javascript News TickerTape Component

20 Apr 2007

UPDATE: A new version of the component is available which supports horizontal scrolling.

This component vertically scrolls a number of items within a container. Each page of items is pulled from a server which supplies JSON data. You can find a demo of the TickerTape in the download archive, and the download for the latest version here. There is a readme.txt in the download, or read on for an example usage.

new TickerTape('tickertape.php', 'myTickerTape', 5000);

The parameters are: the data url, a css class for the container, and the time to pause between scrolling each item. Very simple! I had to do this for a project recently and couldn't find any useful "modern" implementations, so I rolled my own. The core js file is 8.5k without any compression at all, or dependencies.

If you have any recommendations or bugs, please just post them in the comments or email me.

Update: The TickerTape is now available on Google Code.

Feedback or questions on this post? Create an issue on GitHub.