updated code to fire leave, enter and resize in correct order
fixed issue with leave events not firing correctly