仿京东快报向上滚动的实例
程序员文章站
2022-04-16 09:58:54
实例如下:
实例如下:
<!doctype html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <div id="broadcast" class="bar" name="giftactive"> <div style="float:left"><strong>间隔滚动效果:</strong></div> <div id="demo" style="overflow:hidden;height:22px;line-height:22px;"> <ul class="mingdan" id="holder"> <li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank">aaaaaa</a></li> <li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank">bbbbbb</a></li> <li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank">cccccc</a></li> <li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank">dddddd</a></li> <li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank">eeeeee</a></li> </ul> </div> </div> <script type="text/javascript"> function autoscroll(obj) { $(obj).find("ul:first").animate({ margintop: "-22px" }, 500, function() { $(this).css({ margintop: "0px" }).find("li:first").appendto(this); }); } $(document).ready(function() { setinterval('autoscroll("#demo")', 1000) }); </script> </body> </html>
以上这篇仿京东快报向上滚动的实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
上一篇: 基于模板引擎Jade的应用(详解)
下一篇: 【读书笔记】iOS-强类型与弱类型