Home >Web Front-end >JS Tutorial >jQuery method to show the deletion process by fading out after deleting an element_jquery
The example in this article describes how jQuery deletes an element and then uses the fade-out effect to show the deletion process. Share it with everyone for your reference. The specific analysis is as follows:
When we delete an element, we hope to see the deletion process. This effect shows the dynamic deletion process by fading out the element.
$("#myButton").click(function() { $("#myDiv").fadeTo("slow", 0.01, function(){//fade $(this).slideUp("slow", function() {//slide up $(this).remove();//then remove from the DOM }); }); });
I hope this article will be helpful to everyone’s jQuery programming.