I'm trying to make a sticky navbar that becomes fixed after scrolling past the hero section. I'm trying to use materialize to do this, but I'm not very good at javascript so I can't figure it out. I'm trying to use Materialize Pushpin to do it (<http://materializecss.com/pushpin.html>)

Here's my code so far: <https://jsfiddle.net/2kc0fgj5/>
The part I'm trying to make sticky is the .menu div. What would be the method I would use javascript I would use to make the navbar behave this way?

```
<head>
<title>Voice</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.1/css/materialize.min.css">
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>

<body>
<section id="hero" class="segment">
    <div id="hero-content" class="valign-wrapper">
        <div id="hero-child" class="center-align">
            <img src="resources/images/voice-circle.png" id="voice-circle" /><br/>
            <a href="#features" class="btn white blue-text hero-btn">Learn More</a><br/>
            <a href="#" class="btn white blue-text hero-btn">Order Now</a>
        </div>
    </div>
</section>
<div class="menu">
    <nav>
        <div class="nav-wrapper white">
            <a href="#hero" class="brand-logo center blue-text">Voice</a>
            <a href="#" data-activates="mobile-demo" class="button-collapse blue-text"><i class="material-icons">menu</i></a>
            <ul id="nav-mobile" class="right hide-on-med-and-down">
                <li><a href="#features">Features</a></li>
                <li><a href="#testimonials">Testimonials</a></li>
                <li><a href="#workshops">Workshops</a></li>
                <li><a href="#prices">Prices</a></li>
            </ul>
            <ul class="side-nav" id="mobile-demo">
                <li><a href="#features">Features</a></li>
                <li><a href="#testimonials">Testimonials</a></li>
                <li><a href="#workshops">Workshops</a></li>
                <li><a href="#prices">Prices</a></li>
            </ul>
        </div>
    </nav>
</div>
<section id="features" class="segment">

</section>
</body>

```

The accompanying CSS:

```
.segment {
height: 100vh;
width: 100%;
background-color:aquamarine;
}

.divide {
    height: 50vh;
    width: 100%;
}

#hero {
    background-image: url('resources/images/hero%20header.png');
    background-size: auto 100vh;
    background-position: center;
}

.bpblue-text {
    color: #21A1EC;
}

#nav-mobile>li>a {
    color: #21A1EC;
}

#voice-circle {
    width: 30%;
    height: auto;
}

.hero-btn {
    margin: 10px;
    width: 300px;
}

#hero-content {
    width: 100%;
    height: 100vh;
}

#hero-child {
    width: 100%;
}

```

And the current javascript, so far only having smooth scrolling and a side navigation bar

```
$('a[href*="#"]')
// Remove links that don't actually link to anything
.not('[href="#"]')
.not('[href="#0"]')
.click(function (event) {
    // On-page links
    if (
        location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') &&
        location.hostname == this.hostname
    ) {
        // Figure out element to scroll to
        var target = $(this.hash);
        target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
        // Does a scroll target exist?
        if (target.length) {
            // Only prevent default if animation is actually gonna happen
            event.preventDefault();
            $('html, body').animate({
                scrollTop: target.offset().top
            }, 1000, function () {
                // Callback after animation
                // Must change focus!
                var $target = $(target);
                $target.focus();
                if ($target.is(":focus")) { // Checking if the target was focused
                    return false;
                } else {
                    $target.attr('tabindex', '-1'); // Adding tabindex for elements not focusable
                    $target.focus(); // Set focus again
                };
            });
        }
    }
});

$(".button-collapse").sideNav();

```

EDIT: fixed link and added code.