Home > Web Front-end > JS Tutorial > jQuery method to show the deletion process by fading out after deleting an element_jquery

jQuery method to show the deletion process by fading out after deleting an element_jquery

WBOY
Release: 2016-05-16 16:08:47
Original
2040 people have browsed it

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
    });
  });
});
Copy after login

I hope this article will be helpful to everyone’s jQuery programming.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template