Fixing getLocation to work on scrolled pages