CSS style:
<style>*{margin:0;padding:0;}Ul,li{List-style:None;}a{text-decoration:None;}img{Border:None;vertical-align:Top;}#notice{width:500px;Height:40px;position:relative;Overflow:Hidden;margin:50px Auto;Border:1px solid #CCC;}#notice ul{position:Absolute; Left:0;Top:0;}#notice ul Li{width:100%;Height:40px;Line-height:40px;text-indent:20px;}</style>
HTML structure:
<DivID= "notice"> <ul> <Li><ahref="#">Let it all be the water and the past</a></Li> <Li><ahref="#">Take that past as a hangover.</a></Li> <Li><ahref="#">Tomorrow's glass, no more than yesterday's sorrow</a></Li> </ul></Div>
JS code Implementation (need to import the jquery library file first):
functionMovetop (OBJ,NUM,TAG1,TAG2) {//Container element scrolling number of rows parent element child elementvarIH =$ (obj). Find (Tag2). Height (); $ (obj+TAG1). css (' height ', IH *$ (obj). Find (TAG2). length); $ (obj). Find (TAG1). Animate ({' Top ': ih*num},500,function(){ $( This). css ({top:0}). Find (' Tag2:first '). AppendTo ( This); });}varTimer =NULL; a timer= SetInterval (' Movetop (". Notice", 1, "ul", "Li") ', 3000); Automatic Carousel $ (". Notice"). Hover (function() {/////Stop auto-carousel (mouse Move-out events can also be implemented using MouseOver and mouseout) clearinterval (timer); },function() {Timer= SetInterval (' Movetop (". Notice", 1, "ul", "Li") ', 3000); Continue auto-carousel when mouse moves out);
Simple jquery site Announcement Progressive Carousel effect