Hide search bar on scroll

Is there a custom code to hide the search bar on scoll? Possibly drops back down when you scroll upwards?