fix resize function for jquery 1.7