use $.offset instead of $.position
dist