How to show/hide a button based on scroll

how to show/hide a button based on a scroll actually i want to do that when any user cross using scroll on this time showing a go to top button how can i do that help me any one
any help would be highly appreciated
Thanks