Jquery single line text scroll up effect example

  • 2020-03-30 02:14:20
  • OfStack

<div id="title" style="width:100%;height:40px;"> Look at the intermittent scrolling text </div> 

<div id="content" class="infocontent"> 
<div id="top" class="infolist"> 
<li> CCTV 315 exposure :  China resources deeply "sea sand door" response clear and not clear </li> 
<li> Yoshino home was exposed tableware is not disinfected   Bosideng and other cashmere sweaters do not contain cashmere </li> 
<li> Wuxi police announced that "pregnant female police sudden misfortune" after the incident </li> 
<li> Chinese day: the last ferry   Horizon: "done at home" </li> 
<div id="bottom" class="infolist"></div> 
<div id="foot"></div> 

.infolist ul{margin:0;padding:0;} 
.infolist ul li{list-style:none;height:26px;line-height:26px;} 
.infocontent{width:400px;height:26px;overflow:hidden;border:1px solid #666666;} 

var interval=1000;//The time interval between the two rolls
var stepsize=26;//The length of a roll must be a multiple of the height of the row, so as not to break the line
var objInterval=null; 

$(document).ready( function(){ 
//Fill the bottom with the contents of the top

//Binds mouse events to the displayed area

//Start timer

//Start the timer and start rolling
function StartScroll(){ 

//Clear the timer and stop scrolling
function StopScroll(){ 

//Control rolling
function verticalloop(){ 
//Determine whether the upper contents are all moved out of the display area
//If so, start over. Otherwise, keep moving up
//Use jquery to create scrolling animations
{"scrollTop" : $("#content").scrollTop()+stepsize +"px"},600,function(){ 
//Here is the scrollTop used to display the scroll area, please delete it in practice
// $("#foot").html("scrollTop:"+$("#content").scrollTop()); 

Related articles: