New implementation based on jQuery Boilerplate. Fix animation bug.