Home > Article > Web Front-end > Usage examples of fadeOut() method in jQuery_jquery
The example in this article describes the usage of fadeOut() method in jQuery. Share it with everyone for your reference. The specific analysis is as follows:
This method fades out all matching elements through a change in opacity, and optionally triggers a callback function after the animation is complete.
Usage of fadeOut() method:
This method can specify the duration of the animation effect. For example:
The above code stipulates that the fade-out effect of the div can be completed within 5000 milliseconds (5 seconds).
This method can also trigger a callback function after the animation is completed. For example:
The above code can trigger the callback function after the animation is completed, so a prompt box will pop up.
Example code:
The above code can slowly set the div to transparent effect by clicking the button. After it is completely transparent, then specify the callback function.
I hope this article will be helpful to everyone’s jQuery programming.