Replace $.offset with getCliendBoundingRect()