Optimised code, use less jQuery.