jQuery Fadeout Slideup effect to remove an element

    [javascript]
    $("#myButton").click(function() {
    $("#myDiv").fadeTo("slow", 0.01, function(){ //fade
    $(this).slideUp("slow", function() { //slide up
    $(this).remove(); //then remove from the DOM
    });
    });
    });
    [/javascript]

    One Reply to jQuery Fadeout Slideup effect to remove an element

    1. Nono says:

      This is the right solution. A lot of people is looking for this around the internet, without the fading though:

      $(“#item”).slideUp(250, function(){ $(this).remove() } );

      jQuery calls the function inside as a callback when the slideUp function is completed.

    Leave a Reply