最新国产好看的视频,伊人天堂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)才寫了這個(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)畫的時(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)論

抚顺市| 和政县| 天津市| 金塔县| 阆中市| 塔城市| 通城县| 洛隆县| 兴化市| 蓬安县| 尚志市| 青田县| 牡丹江市| 桐乡市| 玉田县| 漠河县| 丹凤县| 巩义市| 武山县| 衡阳县| 龙泉市| 阳山县| 防城港市| 宁安市| 盐边县| 阜阳市| 曲松县| 公安县| 安顺市| 霞浦县| 吉木萨尔县| 湘潭县| 永善县| 四子王旗| 肇庆市| 吴堡县| 清流县| 调兵山市| 阿城市| 博乐市| 基隆市|