title: How to make navbar background appear when scrolling down, but disappear when scrolled up
body: <p>So my background image in my first section goes behind the navbar and underneath it. So basically what I want, when I am scrolled to the top of the page, I want the background of the navbar to disappear, but not the list items in the nav bar. As soon as I scroll down, I would like for a background on the navbar to reappear. I believe this requires jquery, like an if/else statement, which I am not familiar with at all. Also, if I need to add jquery, do I need to add a CDN anywhere in my HTML? If so, where do I place it? If it makes any difference, I used bootstrap to make my navbar. I am only a few days into coding, I'm brand new. Here are my HTML and CSS </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    &lt;style&gt;
          .navbar-default {
              background-color: black !important;
              opacity: .6 !important;
              min-height:90px !important;
              border-radius: 5px !important;
              position: fixed; !important;
              width: 100%; !important;
              z-index: 100 !important;
          }
          .nav li {
              padding-top: 20px;
              padding-right: 15px;
          }
          .nav li a {
              color: white !important;
              font-size: 1.2em !important;
          }
          .navbar-brand {
              padding-right: 50px !important;
          } 
          .topInfo {
              background-image: url('/CMS_Static/Uploads/313864614C6F6F/miami beach-1.jpg');
              background-size: cover;
              background-repeat: no-repeat;
              background-position: center;
              height: 684px;
          }
          .topInfoText {
              color: white;
              padding-top: 220px;
          }
      &lt;/style&gt;
          &lt;!DOCTYPE html&gt;
      &lt;html lang="en"&gt;
        &lt;head&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
          &lt;!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --&gt;
          &lt;!-- Bootstrap --&gt;
          &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"&gt;
          &lt;!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --&gt;
          &lt;!-- WARNING: Respond.js doesn't work if you view the page via file:// --&gt;
          &lt;!--[if lt IE 9]&gt;
            &lt;script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"&gt;&lt;/script&gt;
            &lt;script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"&gt;&lt;/script&gt;
          &lt;![endif]--&gt;
        &lt;/head&gt;
        &lt;body&gt;
          &lt;nav class="navbar-default"&gt;
        &lt;div class="container"&gt;
          &lt;!-- Brand and toggle get grouped for better mobile display --&gt;
          &lt;div class="navbar-header"&gt;
            &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"&gt;
              &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
              &lt;span class="icon-bar"&gt;&lt;/span&gt;
              &lt;span class="icon-bar"&gt;&lt;/span&gt;
              &lt;span class="icon-bar"&gt;&lt;/span&gt;
            &lt;/button&gt;
            &lt;a class="navbar-brand" href="#"&gt;Brand&lt;/a&gt;
          &lt;/div&gt;
      
          &lt;!-- Collect the nav links, forms, and other content for toggling --&gt;
          &lt;div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"&gt;
            &lt;ul class="nav navbar-nav"&gt;
              &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Services&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Locations&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Prices&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Contact&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/div&gt;&lt;!-- /.navbar-collapse --&gt;
        &lt;/div&gt;&lt;!-- /.container-fluid --&gt;
      &lt;/nav&gt;
      
      &lt;section class="topInfo"&gt;
          &lt;div class="container"&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col-md-8 col-md-offset-2"&gt;
                      &lt;h1 class=" topInfoText text-center"&gt;Aerial Photography In South Florida&lt;/h1&gt;
                      
                  &lt;/div&gt;
              &lt;/div&gt;
              
          &lt;/div&gt;
      &lt;/section&gt;
      
          &lt;!-- jQuery (necessary for Bootstrap's JavaScript plugins) --&gt;
          &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"&gt;&lt;/script&gt;
          &lt;!-- Include all compiled plugins (below), or include individual files as needed --&gt;
          &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"&gt;&lt;/script&gt;
        &lt;/body&gt;
      &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>