Can some one help me impliment a Sticky Header Js?

I need my header to scroll and then stay stuck on to the top of the screen but only as a nav bar.

I am looking for the Js solution, not the CSS solution.

I tried a plugin called Sticky Header.Js but it didnt seem to have an affect, maybe because I already did the CSS sticky header.

Thank you