Wanting [in 2007] to create a news ticker along the lines of that then used on the BBC news site, I took a look around for a handy plugin to do it, but with no success. So... I created my own, as a jQuery plugin.
You can download it, or read on for the demo and documentation.
Put this code in your <head> section, or just before your closing body tag, if you prefer.
<script src="jquery.js"></script> <script src="jquery.newsTicker-2.3.6.js"><script> <script> $(document).ready(function() { var options = { newsList: "#news", startDelay: 10, placeHolder1: " []" } $().newsTicker(options); }); </script>
Use the following code for your list of items for the ticker
<ul id="news"> <li><a href="http://www.makemineatriple.com">MakeMineATriple.com</a></li> <li><a href="http://www.jquery.com">jQuery</a></li> </ul>
Underline text decoration on the link is not recommended!
The options (defaults shown) are:
If you enable the controls, the following will be added just after your list of items:
<ul class="ticker-controls"> <li class="play"><a href="#play">Play</a></li> <li class="resume"><a href="#resume">Resume</a></li> <li class="stop"><a href="#stop">Stop</a></li> <li class="previous"><a href="#previous">Previous</a></li> <li class="next"><a href="#next">Next</a></li> </ul>
Alternatively, if you wish to use controls but use your own markup for them, set the 'ownControls' parameter to true (which sets 'controls' as true) and apply the appropriate classes to your control elements as per the above controls)
Only a subset of these controls will be visible at any one time, depending on the play state of the ticker.
© Bryan Gullan