jquery 新闻循环切换
1. jQuery演示三种文字垂直滚动
http://www.sucaihuo.com/js/459.html
这个是Bootstrap-News,官方下载:http://www.jqueryscript.net/slider/Responsive-jQuery-News-Ticker-Plugin-with-Bootstrap-3-Bootstrap-News-Box.html
2. 不用其他框架
简单实现参考 http://blog.csdn.net/chuntian1983/article/details/7950886
HTML 部分: <ul id="letter-scroll"> <li>第一条消息</li> <li>第二条消息</li> <li>第三条消息</li> </ul> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ scrollNews("letter-scroll", 5); }); /** * 滚动切换消息 * @param selectorId 外部容器ID * @param time 时间(秒),多久切换一次 */ function scrollNews(selectorId, time) { time = time * 1000; var selector = $("#"+selectorId); // selector.find("li:not(:first)").css("display","none"); var B=selector.find("li:last"); var C=selector.find("li:first"); var intervalFunction = function(){ if(B.is(":visible")){ C.fadeIn(500).addClass("in"); B.hide(); }else{ selector.find("li:visible").addClass("in"); selector.find("li.in").next().fadeIn(500); selector.find("li.in").hide().removeClass("in") } }; var intervalId = setInterval(intervalFunction, time); $("#letter-scroll").bind("mouseenter",function(){ clearInterval(intervalId); }).bind("mouseleave",function(){ intervalId = setInterval(intervalFunction, time); }); } </script>
相关推荐
EdwardSiCong 2020-11-23
85477104 2020-11-17
hhanbj 2020-11-17
81427005 2020-11-11
seoppt 2020-09-13
honeyth 2020-09-13
WRITEFORSHARE 2020-09-13
84483065 2020-09-11
momode 2020-09-11
85477104 2020-08-15
83510998 2020-08-08
82550495 2020-08-03
tthappyer 2020-08-03
84901334 2020-07-28
tthappyer 2020-07-25
TONIYH 2020-07-22
tztzyzyz 2020-07-20
83510998 2020-07-18
81463166 2020-07-17