Jquery implements announcement tumble effect _ jquery

Source: Internet
Author: User
Tags comparison table
This article will share with you a code that uses jQuery to implement the rolling effect of announcements. it is very concise and practical, and has excellent compatibility. Here we recommend you to our partners that the rolling effect is very good, the code is also very simple, so there is not much nonsense here.

The code is as follows:


// Style file:

Header js

Don't forget to import the jquery library

The code is as follows:


$ (Function (){
Var settime;
$ (". ScrollNews"). hover (function (){
ClearInterval (settime );
}, Function (){
Settime = setInterval (function (){
Var $ first = $ (". scrollNews ul: first"); // select the first ul under p instead of li;
Var height = $ first. find ("li: first"). height (); // Obtain the height of the first li to prepare for ul to move up;
$ First. animate ({"marginTop":-height + "px"}, 600, function (){
Repeated first.css ({marginTop: 0}). find ("li: first"). appendTo ($ first); // you can set the top margin to zero to prepare for next move.
});
},3000 );
}). Trigger ("mouseleave"); // trigger () is used to trigger the event type of the selected element.
});

Jsp text area

The code is as follows:



  



  • Query module menu name update announcement: from, the query module menu uses a new name. for details, see [query module new and old name comparison table] below ].


  • Query module menu name update announcement: from, the query module menu uses a new name. for details, see [query module new and old name comparison table] below ].



Let's make full use of it and apply it to your own projects.

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.