最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

基于Jquery的文字滾動(dòng)跑馬燈插件(一個(gè)頁(yè)面多個(gè)滾動(dòng)區(qū))

 更新時(shí)間:2010年07月26日 14:00:55   作者:  
文字逐行或多行滾動(dòng)跑馬燈插件,基于Jquery。命名為Jquery.RollTitle。支持在一個(gè)頁(yè)面聲明多個(gè)滾動(dòng)區(qū) (就為了要這點(diǎn)才寫(xiě)了這個(gè))
兼容各瀏覽器的文本行高
復(fù)制代碼 代碼如下:

(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, //卷動(dòng)速度,數(shù)值越大,速度越慢(毫秒
_this.timespan=opt.timespan?parseInt(opt.timespan,13):5000; //滾動(dòng)的時(shí)間間隔(毫秒
if(_this.line==0) this.line=1;
_this.upHeight=0-_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);
}).mouseout();
}
})
})(jQuery);

調(diào)用方法:
line:一次卷動(dòng)的文本行數(shù)
speed:卷動(dòng)動(dòng)畫(huà)的時(shí)間
timespan:間隔時(shí)間
復(fù)制代碼 代碼如下:

<html>
<body>
<ul id="RunTopic">
<li>文字1</li>
<li>文字2</li>
<li>文字3</li>
<li>文字4</li>
<li>文字5</li>
</ul>
</body>
<script type="text/javascript">
$(document.body).ready(function(){
$("#RunTopic").RollTitle({line:1,speed:200,timespan:1500});
});
</script>
</html>

相關(guān)文章

最新評(píng)論

东台市| 九龙县| 垫江县| 介休市| 扬州市| 静安区| 南木林县| 昭平县| 齐河县| 珲春市| 文化| 北辰区| 凌云县| 霍林郭勒市| 柘城县| 屏东市| 泰州市| 仲巴县| 普定县| 宁强县| 桑日县| 镇巴县| 治多县| 桂林市| 宜黄县| 东辽县| 南京市| 洮南市| 山阳县| 永仁县| 页游| 天津市| 台北市| 双峰县| 安图县| 个旧市| 甘谷县| 铅山县| 锡林浩特市| 类乌齐县| 平邑县|