JS Section
Copy codeThe Code is as follows: $ (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 Copy codeThe Code is as follows: <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> 3 not added </a> </li>
<Li> <a> 4 not added </a> </li>
<Li> <a> Siemens </a> </li>
<Li> <a> OMRON </a> </li>
</Ul>
</Div>