This article mainly introduces the usage of the fadeOut () method in jQuery, and analyzes the functions, definitions, and specific usage skills of the fadeOut () method in the form of examples, which has some reference value, for more information about how to use the fadeOut () method in jQuery, see the following example. Share it with you for your reference. The specific analysis is as follows:
This method fades out all matching elements by changing the opacity, and triggers a callback function after the animation is complete.
Usage of the fadeOut () method:
This method specifies the animation duration. For example:
The Code is as follows:
$ ("P"). fadeOut (5000)
The above Code specifies that the fade-out effect of p can be completed within 5000 milliseconds (5 seconds.
This method can also trigger a callback function after the animation is completed. For example:
The Code is as follows:
$ ("P"). fadeOut (5000, function () {alert ('animation effect completed! ')})
The above code triggers the callback function after the animation is complete, so a prompt box is displayed.
Instance code:
The Code is as follows:
FadeOut () function-script house