This article mainly describes the basic usage of jQuery's animate function, and uses the animation function animate to realize the effect of the pea emission. It is very helpful for learning the animation function and can be used as a reference if necessary. Peas, lawns, and bullets are all ready-made images,
1. Is jQuery a library or framework?
JQuery is now the most popular js class library, rather than the framework.
Previously, I saw someone say this in zhihu:
You call library. Framework callyou.
I think that, literally, you can use a class library without constraints, but you need to use a framework under various constraints.
I personally think that the js library refers to an API that interacts directly with document elements. You can directly reference the library to serve you. The framework is biased towards the architecture level. If you want to use the framework, you must follow its rules. For example, angular. js provides methods and limits the dom document structure.
Taking the three major Java frameworks as an example, if you want to use Spring, you have to follow its steps, just like a house, reinforced concrete has been completed, you only need to enter the decoration and it will be OK. The library is a bit similar to the charm of StringUtils. In addition to the interfaces exposed by it, you don't need to worry about anything else. Just call it directly.
2. the animate function of jQuery
The animate () function is used to execute a css-based Custom Animation.
Basic usage:
$('#id').animate(css,time,callback);
Css: List of final styles you need to implement
Time: the time of transition.
Callback: callback function
The role of the animate function is to achieve the transition effect of some css styles.
3. Introduce jQuery
For example, I have a p box.