JQuery控制文字间歇性向上滚动,每次向上滚动一行[转载]
<style>
#scroll-list{height:150px;overflow:hidden;}
</style>
<script language="javascript" type="text/javascript" src="http://www.93union.com/js/jquery.min.js"></script>
<script>
$(function(){
var $swap = $('#scroll-list');
var movetotop;
$swap.hover(function(){
clearInterval(movetotop);
},function(){
movetotop=setInterval(function(){
var li_height = $swap.find('li').height();
var newli = $swap.find('li:first').clone();
newli.appendTo($swap);
$swap.find('li:first').animate({marginTop:-li_height + 'px'},600,function(){
$swap.find('li:first').remove();
});
},2000);
}).trigger('mouseleave');
});
</script>
<ul id="scroll-list">
<li>1.Baby I miss you so</li>
<li>2.I would never ever let you go</li>
<li>3.Baby cause I need I need your love (yeah~)</li>
<li>4.(ohh~~)I am sure I never get enough</li>
<li>5.Baby let me start a new Romance</li>
<li>6.I would never ever have this chance</li>
<li>7.I never ever find another you</li>
<li>8.(ohh~~)I swear the lide of love its true</li>
</ul>
演示地址:http://www.93union.com/textscrollup.html
#scroll-list{height:150px;overflow:hidden;}
</style>
<script language="javascript" type="text/javascript" src="http://www.93union.com/js/jquery.min.js"></script>
<script>
$(function(){
var $swap = $('#scroll-list');
var movetotop;
$swap.hover(function(){
clearInterval(movetotop);
},function(){
movetotop=setInterval(function(){
var li_height = $swap.find('li').height();
var newli = $swap.find('li:first').clone();
newli.appendTo($swap);
$swap.find('li:first').animate({marginTop:-li_height + 'px'},600,function(){
$swap.find('li:first').remove();
});
},2000);
}).trigger('mouseleave');
});
</script>
<ul id="scroll-list">
<li>1.Baby I miss you so</li>
<li>2.I would never ever let you go</li>
<li>3.Baby cause I need I need your love (yeah~)</li>
<li>4.(ohh~~)I am sure I never get enough</li>
<li>5.Baby let me start a new Romance</li>
<li>6.I would never ever have this chance</li>
<li>7.I never ever find another you</li>
<li>8.(ohh~~)I swear the lide of love its true</li>
</ul>
演示地址:http://www.93union.com/textscrollup.html