The Archives

SEARCH

About There4

I build simple, clean, and maintainable internet applications. People should never need an owners manual to use software, I believe that applications can be easy to use while still being powerful. Applications should remain valuable through their entire lifespans, and should be flexible enough to grow and change as requirements shift.

I prefer to develop with Blueprint CSS, jQuery, and Cake PHP. I have extensive development history with PHP, MySQL, Microsoft SQL, and mixed Win32/Linux hosting environments.

Follow me on Twitter

Posting tweet...

Archive for October, 2009

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;
};