You could either store x and y from mousedown event since it will fire before click, or use getcursorpos and clienttoscreen api to get the position in pixels