Script for setting hero sec to 100% height for mobile&tablets

Hi

I know you can use a 100% value for height or even 100vh, but these values cause the page to ‘pop’ when scrolling on mobile and tablet devices.

Is their a JS script availble that can set the height of a hero sec to fit the view-able height of that particular device?

thanks