Navigation bar remains fixed at the top of the browser's viewport when scrolled down

Hi everyone,

I’m hoping to achieve this effect where an element (most commonly, a horizontal navigation bar), remains fixed after the website is scrolled down.

Here’s an example: http://supereightstudio.com/

You might notice that a smaller logo also appears on left of the navigation as you scroll down. Anyone has any idea how is this achieved?

Any tip is appreciated. Thanks.