最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
js中实现滚屏效果方法总结
时间:2013-02-22 编辑:简简单单 来源:一聚教程网
三:用setInterval函数实现
代码如下 | 复制代码 |
|
附注:一个扩展
代码如下 | 复制代码 |
jQuery.fn.extend({ justUp : function(aSpeed,duration) { this.css({"height":"25px","line-height":"25px"}); this.each(function(){ var _this = this; var iTimer=0; function scroll(){ iTimer = setInterval(function(){ $(_this).animate({marginTop:"-25px"},aSpeed||500,function(){$(_this).css ({marginTop:"0px"}).find("li:first").appendTo(_this);}); },duration||3000); } scroll(); $(this).hover(function(){this.style.cursor = "pointer";clearInterval(iTimer);},scroll); }); } });
|
水平滚动
代码如下 | 复制代码 |
// 水平滚动插件 (function($){ $.fn.extend({ Scroll:function(opt,callback){ 容器高度 |
相关文章
- js实现音乐播放器代码展示 10-12
- js实现图片查看器代码展示 10-12
- JS中switch的四种写法介绍 10-12
- js实现新闻轮播效果教程 10-11
- JS实现简单的图片切换功能教程 10-11
- js实现下拉刷新和上拉加载解析 09-28