:
jQuery news ticker是一個非常方便的jQuery外掛程式,能夠快速讓你產生這樣的一個新聞行情效果。
它能夠通過列表,HTML甚至是RSS(只能載入本站的RSS feed)來產生新聞內容,並且支援前後播放和停止。這個外掛程式支援一系列的自訂選項,例如:
播放速度
播放效果
播放方向
顯示時間
代碼開發簡單高效。
首先引入jQuery news ticker類庫及其jQuery類庫:
複製代碼 代碼如下:
<link href="css/ticker-style.css" rel="stylesheet" type="text/css" />
<script src="jquery.ticker.js" type="text/javascript"></script>
HTML代碼:
複製代碼 代碼如下:
<div id="ticker-wrapper" class="no-js">
<ul id="js-news" class="js-hidden">
<li class="news-item"><a href="#">This is the 1st latest news item.</a></li>
<li class="news-item"><a href="#">This is the 2nd latest news item.</a></li>
<li class="news-item"><a href="#">This is the 3rd latest news item.</a></li>
<li class="news-item"><a href="#">This is the 4th latest news item.</a></li>
</ul>
</div>
javascript:
複製代碼 代碼如下:
<script type="text/javascript">
$(function () {
$('#js-news').ticker();
});
</script>
官方網站 http://www.gbin1.com/technology/jquerynews/20111105jquerypluginnewsticker/demo.html
相關檔案下載