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.