Jquery seamless intermittent upward scrolling
JS Section
View code
$ ( Function (){
VaR $ This = $ (". Renav ");
VaR Scrolltimer;
$ This . Hover ( Function (){
Clearinterval (scrolltimer );
}, Function (){
Scrolltimer = setinterval ( Function (){
Scrollnews ($ This );
},2000 );
}). Trigger ("mouseout ");
});
Function Scrollnews (OBJ ){
VaR $ Self = obj. Find ("Ul: First ");
VaR Lineheight = $ self. Find ("Li: First"). Height ();
$ Self. animate ({"margin-top":-lineheight + "PX"}, 600, Function (){
Export self.css ({"margin-top": "0px"}). Find ("Li: First"). appendto ($ self );
})
}
HTML section
View code
< Style Type = "Text/CSS" >
. Renav {
Width : 200px ;
Height : 150px ;
Line-height : 21px ;
Overflow : Hidden ;
Background : # Ffffff ;
}
. Renav Li {
Height : 21px ;
}
</ Style >
< Div Class = "Renav" >
< Ul Style = "Margin-top: 0px ;" >
< Li > < A > Roche </ A > </ Li >
< Li > < A > Ruishengda </ A > </ Li >
< Li > < A > 1 not added </ A > </ Li >
< Li > < A > 2 not added </ A > </ Li >
< Li > < A > Not added 3 </ A > </ Li >
< Li > < A > Not added 4 </ A > </ Li >
< Li > < A > Siemens </ A > </ Li >
< Li > < A > OMRON </ A > </ Li >
</ Ul >
</ Div >