News ticker (BBC style)

联合创作 · 2023-10-02 16:09

News ticker in the style of that used on the BBC news site.

Sample usage:

$(document).ready(function() {
  var options = {
    newsList: "#news",
    startDelay: 10,
    placeHolder1: " []"
  }
  $().newsTicker(options);
});

for markup as follows:
<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 (un-hovered) link is not recommended, for obvious reasons! :-)

The full set of options is:

  • newsList: "#news" // assumes unordered list; specify the ul holding the news items
  • tickerRate: 80 // time gap between display of each letter (ms)
  • startDelay: 100 // delay before first run of the ticker (ms)
  • loopDelay: 3000 // time for which full text of each item is shown at end of print-out (ms)
  • placeHolder1: " |" // character placeholder shown on even loops
  • placeHolder2: "_" // character placeholder shown on odd loops
浏览 9
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报