[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]
[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]
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.