jQuery垂直新闻滚动代码
包括手动与自动滚动
XML/HTML Code
- <div class="col-md-4">
- <div class="panel panel-default">
- <div class="panel-heading">
- <span class="glyphicon glyphicon-list-alt"></span><b>News</b></div>
- <div class="panel-body">
- <div class="row">
- <div class="col-xs-12">
- <ul class="demo2">
- <li class="news-item">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in venenatis enim... <a href="#">Read more...</a></li>
- <li class="news-item">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in venenatis enim... <a href="#">Read more...</a></li>
- <li class="news-item">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in venenatis enim... <a href="#">Read more...</a></li>
- <li class="news-item">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in venenatis enim... <a href="#">Read more...</a></li>
- <li class="news-item">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in venenatis enim... <a href="#">Read more...</a></li>
- <li class="news-item">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in venenatis enim... <a href="#">Read more...</a></li>
- </ul>
- </div>
- </div>
- </div>
- <div class="panel-footer">
- </div>
- </div>
- </div>
JavaScript Code
- $(".demo2").bootstrapNews({
- newsPerPage: 4,
- autoplay: true,
- pauseOnHover: true,
- navigation: false,
- direction: 'down',
- newsTickerInterval: 2500,
- onToDo: function () {
- //console.log(this);
- }
- });
原文地址:http://www.freejs.net/article_jquerywenzi_625.html