function to scroll smoothly anywhere