Home > Web Front-end > JS Tutorial > body text

How to use jQuery to show the deletion process by fading out after deleting an element

巴扎黑
Release: 2017-06-30 11:36:26
Original
1365 people have browsed it

This article mainly introduces the method ofjQuerydeletethe fade-out effect after deleting an element to show the deletion process. It analyzes the fadeTo and slideUp methods in jQuery with examples. The usage skills are of great practical value. Friends in need can refer to

. This article describes the method of jQuery deleting an element and then fading out the 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() {
  $("#myp").fadeTo("slow", 0.01, function(){//fade
    $(this).slideUp("slow", function() {//slide up
      $(this).remove();//then remove from the DOM
    });
  });
});
Copy after login

The above is the detailed content of How to use jQuery to show the deletion process by fading out after deleting an element. For more information, please follow other related articles on the PHP Chinese website!

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