I recently read some basic JQuery tutorials, which are deeply attracted by JQuery. I have used Extjs before. I can't help but sigh when I read JQuery. It's amazing that javascript can be used! I have posted some learning achievements here, hoping to help others who want to learn JQuery and record their learning status.
into one object.
Parameter decomposition:
Properties: A key-value pair of one or more CSS properties that constitutes an object. It is important to note that all properties used for animations must be numeric unless otherwise noted; These properties cannot use basic jquery functionality if they are not numeric. For example, border, margin, padding, width, height, font, left, top, right, bottom, wordspacing, and so on are all animation effects. Back
jquery animation effects animate and ScrollTop use instances togetherAnimate is a special effect function method of JQ, and the Animate () method performs a custom animation of the CSS property set. This method changes the element from one state to another through CSS styles.CSS property values are changed gradually so that you can create animation effects.Only n
). Animate ({top: "200px", Width: "200px"},3000). FadeOut ("slow");Add the Stop () method to the hover event to resolve an issue in which the cursor action is inconsistent with the animation effect when the move-out action is too fastNote: You need to add stop () to move in$ (". Panel"). Hover (function () {$ (this). Stop (). Animate ({height: "max", Width: "},3000")},function () {$ (this). Stop ( ).
jquery provides "linear" and "swing".
Callback (optional) function that is executed when the animation completes
Example
Describe:
Click on the button after the DIV element of several different attributes change together
HTML Code:
Copy Code code as follows:
Apply three different types of effects in one animation
$ ("#go"). Click (function () {
$ ("#block"). Animate ({
Width: "90%",
Before today, I still focused on the most common usage of the animate () method in jQuery. I checked the manual and found that several useful callback functions were added at 1.8, let's take a look at the usage and precautions of animate in jQuery, so that you can refer to it when you need it. Let's take a look at it.
"). Animate ({width: ' 300px ',fontsize:30,backgroundcolor: ' Red '},500);(1) The above 2 refers to the middle with a horizontal line of the attribute to remove the horizontal line, and so on, in this case backgroundcolor the same , but animate itself can not set the color and other properties, you need to introduce the following JS to use:: http://www.bitstorm.org/jque
As you can see from the jquery API documentation, the jquery custom animation function. Animate (properties [, duration] [, easing] [, complete]) has four parameters:
Properties: a set of style attributes and their values that are included as animation properties and end values
Duration (optional): animation execution time, whose value can be one of three prede
The function used to create the custom animation.return value: JQuery animate (params, [duration], [easing], [callback])If you are using a string value such as "Hide," "Show," or "toggle," the default animated form is called for the property. Paramsoptions a group of packagesContains a collection of style attributes and their values as animated and final valuesParams object {}, note: All specified propertie
Animate (params, [duration], [easing], [callback])
A function to create a custom animation.
The key to this function is to specify the animation form and the result style Property object. Each property in this object represents a style attribute that can be changed (such as "height", "top", or "opacity"). Note: All specified attributes must be in camel form, such as marginleft instead of Margin-left.
The animation ends when the value of each property
CSS3 and jquery can all implement ease chasing, but with browser compatibility, the jquery animate method is recommended.
First show you the implementation of the results are as follows:
Effect Demo Source Download
Referencing files: jquery-1.11.1.min.js
Html
Jq
speed strings ("slow", "normal", or "fast ") or a millisecond value (for example, 1000) indicating the animation duration)
Easing string :( default value: "Swing") Name of the erased effect to be used (supported by plug-ins). By default, jquery provides "linear" and "Swing ".
Complete function: the function executed when the animation is completed.
Step callback
Set queue Boolean (default: True) to false to prevent this animation from entering the an
jquery animations can have a lot of effect and support extended animations, where http://easings.net/zh-cn# has a very useful animation extension based on jquery, especially on some curves or parabolic lines where it is difficult to make ideal animations.The core idea of jquery animation is to divide the whole interval into n time period, and calculate the interv
false, that is, to stop the current animation, set to True, to complete the current animation immediately.
Yes, the above example does validate the arguments of the stop function.
But, ni, I wrote another example, I feel the foot of my cognition has been overturned ...
Online demo, please jab jquery stop Example 3
Html:
Javascript:
Animate question One
Ani
Use the animation function animate of jQuery to implement the pea emission effect.
Let's take a look
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
addition to its exposed interface, other you do not need to care, direct call on the line.
2. jquery's animate function
animate()function to perform a custom animation based on CSS properties
Basic usage:
$ (' #id '). Animate (Css,time,callback);
CSS: The list of styles you need to implement finally
Time : Timing of transition
callback: callbac
How to Use jQuery animate easing, jqueryeasing
As you can see from the jQuery API documentation, the jQuery Custom Animation function. animate (properties [, duration] [, easing] [, complete]) has four parameters:
Properties: a set of style attributes and their values tha
JQuery animate and CSS3 are combined to achieve slow-moving Chase Effect. Source Code download is provided. jquerycss3
Both CSS3 and jquery can achieve a slow chase effect. However, considering the compatibility of browsers, we recommend that you use the jquery animate metho
As you can see from the jquery API documentation, the jquery custom animation function. Animate (properties [, duration] [, easing] [, complete]) has four parameters:
Properties: A set of style attributes and their values that are included as animation properties and end values
Duration (optional): Animation execution time, whose value can be one of three prede
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.