Based on jquery The text runs up like a horse-lamp effect _jquery

Source: Internet
Author: User

Want to achieve a similar effect of a horse lamp, found that the lantern has a space. The effect is also not beautiful, so with JQuery wrote a

Page code

 <div class= "Recordlist" > <ul class= "tpl-rotate-recordlist" style= "margin-top:0px"; > <li class= "Tpl-rotate-recordlist-item" > Congratulations 187****5204 get 1000RBM </li> <li class= " 
Tpl-rotate-recordlist-item "> Congratulations 137****1372 get 1000RBM </li> <li class=" Tpl-rotate-recordlist-item "> 
Congratulations 156****0276 get 1000RBM </li> <li class= "Tpl-rotate-recordlist-item" > Congratulations 139****9856 get 1000RBM </li> <li class= "Tpl-rotate-recordlist-item" > Congratulations 136****0580 get 1000RBM </li> <li class= " 
Tpl-rotate-recordlist-item "> Congratulations 136****0580 get 1000RBM </li> <li class=" Tpl-rotate-recordlist-item "> 
Congratulations 138****8118 get 1000RBM </li> <li class= "Tpl-rotate-recordlist-item" > Congratulations 136****5555 get 1000RBM </li> <li class= "Tpl-rotate-recordlist-item" > Congratulations 136****0580 get 1000RBM </li> <li class= " Tpl-rotate-recordlist-item "> Congratulations 136****0580 get 1000RBM </li> </ul> </div> 

JS Code

/* Automatic rotation xuyw*/ 
var autoscroll = function (a) { 
$ (a). Find ("Ul:first"). Animate ({ 
margintop: " -20px" 
}, function () { 
$ (this). css ({ 
margintop: "0px" 
}). Find ("Li:first"). Appendto (This) 
}) 
} 
if ($ (". Recordlist ul li"). Length > 0) { 
setinterval (' AutoScroll ('. Recordlist ') ', Watts) 
} else { 
$ (". Recordlist"). Hide () 
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.