本篇文章主要介绍了" js实现文字从右滚动到左边代码循环滚动实例",主要涉及到方面的内容,对于Javascriptjrs看球网直播吧_低调看直播体育app软件下载_低调看体育直播感兴趣的同学可以参考一下:
以下是代码实例:
以下是代码实例:
<divstyle="background:#333;"><divid="tgBigox"><divid="tgGoox"><ahref=""target="_blank">a>div>div>div><scripttype="text/javascript">var cars = $("#tgGoox").width();
var i =0;
functionstart(){
i--;
if(i<=-cars){
i=2*cars;
document.getElementById('tgGoox').style.right =-cars+'px';
}else{
document.getElementById('tgGoox').style.left =i+'px';
}
setTimeout(start,10);
}
>function(){setTimeout(start,1000)};
script>
css样式:
#tgBigox{
position: relative;
width:900px; margin:0 auto; height:30px; line-height:30px; padding-right:65px; overflow:hidden;
}#tgGoox{
position: absolute;
height:30px; line-height:30px;
top:0px;
left:0;
}#tgGooxa{
color:#fff;
margin-left:8px;
float:left;
}#tgGooxa:hover{
color:#57bc54;
}
').addClass('pre-numbering').hide();
$(this).addClass('has-numbering').parent().append($numbering);
for (i = 1; i <= lines; i++) {
$numbering.append($('
').text(i));
};
$numbering.fadeIn(1700);
});
});
以上就介绍了 js实现文字从右滚动到左边代码循环滚动实例,包括了方面的内容,希望对Javascriptjrs看球网直播吧_低调看直播体育app软件下载_低调看体育直播有兴趣的朋友有所帮助。
本文网址链接:http://www.codes51.com/article/detail_3783322.html