最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
同一页面多次调用的基于Jquery的文字滚动跑马灯插件
时间:2010-07-26 编辑:简简单单 来源:一聚教程网
调用方法:
line:一次卷动的文本行数
speed:卷动动画的时间
timespan:间隔时间
- 文字1
- 文字2
- 文字3
- 文字4
- 文字5
jquery代码
(function($){
$.fn.extend({
rolltitle: function(opt,callback){
if(!opt) var opt={};
var _this = this;
_this.timer = null;
_this.lineh = _this.find("li:first").height();
_this.line=opt.line?parseint(opt.line,15):parseint(_this.height()/_this.lineh,10);
_this.speed=opt.speed?parseint(opt.speed,10):3000, //卷动速度,数值越大,速度越慢(毫秒
_this.timespan=opt.timespan?parseint(opt.timespan,13):5000; //滚动的时间间隔(毫秒
if(_this.line==0) this.line=1;
_this.up-_this.line*_this.lineh;
_this.scrollup=function(){
_this.animate({
margintop:_this.upheight
},_this.speed,function(){
for(i=1;i<=_this.line;i++){
_this.find("li:first").appendto(_this);
}
_this.css教程({margintop:0});
});
}
_this.hover(function(){
clearinterval(_this.timer);
},function(){
_this.timer=setinterval(function(){_this.scrollup();},_this.timespan);
}).mouseo教程ut();
}
})
})(jquery);
相关文章
- HTML简单购物数量小程序代码展示 10-31
- html canvas实现弹幕功能 10-31
- HTML中空格表示的意义 10-31
- html area标签解读 10-31
- html使用表单标签实现注册页面代码展示 10-31
- 使用HTML截图并保存为本地图片的代码展示 10-31