<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style> .loop-scroll-demo { height: 600px; width: 600px; overflow: hidden; } .loop-scroll-demo div { height: 100px; margin: 5px; background-color: gray; text-align: center; font-size: 3em; } </style> <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script> /* 插件实现 @author wanglong copyright zhongsou.com */ $.fn.loopScroll = function() { return this.each(function() { var _interval = 0, self = $(this).hover(function() {clearInterval(_interval);}, function() { _interval = setInterval(function() { var last = self.children(":last"), height = last.height(); last.css({ height : 0, opacity : 0 }).prependTo(self).animate({ height : height }, 400, function() { last.animate({ opacity : 1 }, 400); });}, 2000);}).mouseleave();});}; /*调用插件方法*/ $(function() { $(".loop-scroll-demo").loopScroll(); }); </script> </head> <body> <div class="loop-scroll-demo"> <div>微博01</div> <div>微博02</div> <div>微博03</div> <div>微博04</div> <div>微博05</div> <div>微博06</div> <div>微博07</div> <div>微博08</div> <div>微博09</div> <div>微博10</div> <div>微博11</div> <div>微博12</div> <div>微博13</div> <div>微博14</div> <div>微博15</div> <div>微博16</div> <div>微博17</div> <div>微博18</div> <div>微博19</div> <div>微博20</div> </div> </body> </html>
详细解决方案
八行代码实现的新浪微博滚屏特效-jQuery plugin
热度:92 发布时间:2012-08-21 13:00:22.0
相关解决方案
- jquery 获取jsp页面的id解决方法
- jquery,二维数组取值。解决办法
- 求jquery.form.js+jquery.validate.min.js 用ajax提交表单的代码范例
- jquery 提交form表单不用插件的那种 如何提交
- jquery ajax回传没有值,该怎么处理
- jquery easyUI datagrid struts2有关问题
- jquery form 有关问题
- springmvc jquery ajax 提交复杂对象,415异常解决办法
- 应用Struts2 与 jquery,ajax验证用户注册,不用从数据库获取数据
- jquery ajax select解决方法
- 请教哪里可以上到 struts2-json-plugin-2.1.8的源文件
- php jquery check username ajax检察帐号唯一性
- Mybatis 自定义 Plugin(Interceptor) 研讨! 急
- jquery ajax返回值的有关问题
- jquery 或js 获取指定字符间的字符串,并轮换。回答出来的是大神级~
- jquery 的bind里面能不能获得返回值呢? 对小弟我很难的有关问题啊
- jquery 的uploadify下传图片怎么让出错信息提示成中文
- java+jquery easy ui + json + struts分页例子
- jquery easyui分页效率有关问题
- jquery 如何获得动态添加后的子元素个数?
- jQuery.ajax()请求struts2数据 回到data值了undefined
- 关于Struts2 jQuery Plugin的 Result,该如何处理
- Jquery 点击按钮实现图片翻页,该如何解决
- jquery 关于监听checkbox的选中和不选中事件,该如何解决
- jQuery append动态添加的页面对象如何处理刷新掉
- Jquery+json解决思路
- jquery post有关问题
- 求大神解决偏题 - jquery ajax
- jquery $.ajax有关问题
- jquery td遍历有关问题