SEARCH
jQuery slideRemove()
Posted in: Blog, JavaScript by Craig Davis on October 3, 2009
I’ve often run into times that I have wanted to use jquery to fade an element, and slide up the open space, and then remove the element from the page. I’ve written a small jQuery function to handle this.
jQuery.fn.slideRemove = function(callback) {
$(this).blur().fadeTo('medium', 0, function() { // fade
$(this).slideUp('medium', function() { // slide up
$(this).remove(); // remove from DOM
if (callback) { callback(); }
});
});
return this;
};