title: change logo scrolling navbar - materialize?
body: <p>I hope someone can help me, I would like the scroll of the navbar to change the image of the logo. </p>
  
  <p>I am a novice but stubborn I tried online to look for something similar but for my purpose, I could not find anything.</p>
  
  <p>I just want to change the logo image on the scroll.</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-js lang-js prettyprint-override"><code>$(document).scroll(function() {
    if ($(this).scrollTop() &gt;= 30) {
      $(" .brand-logo").html("&lt;img src='img/edizioni-white.png'&gt;");
    } else {
      $(".brand-logo").html("&lt;img src='img/edizioni-black.png'&gt;");
    }
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>nav {
    position: fixed;
    top: 0;
    left: 0;
    height: 84px;
    width: 100%;
    background-color: #fff;
    padding: 20px 18px;
    transition: background-color 0.4s ease-out;
  }
  
  nav#navbar {
    height: 95px;
  }
  
  nav.scroll {
    background-color: #000 !important;
    height: 95px;
    transition: background-color 1000ms;
    color: #fff !important;
  }
  
  a.color-font-menu {
    color: black;
    font-size: 20px;
  }
  
  nav.scroll a {
    color: white;
  }
  
  .brand-logo img {
    height: auto;
    width: 130px!important;
    margin-top: -20px;
  }
  
  .box {
    height: 500px;
    margin-top: 100px;
  }
  
  .box.orange {
    margin-top: 200px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!--Import Google Icon Font--&gt;
  &lt;link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"&gt;
  &lt;link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css" rel="stylesheet"&gt;
  
  &lt;!--Import materialize.css--&gt;
  &lt;link href="../materialize/core/css/materialize.min.css" type="text/css" rel="stylesheet" media="screen,projection" /&gt;
  
  &lt;!-- begin snippet: js hide: false console: true babel: false --&gt;
  
  &lt;!-- Let browser know website is optimized for mobile --&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
    &lt;!--JavaScript at end of body for optimized loading --&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="../materialize/core/js/materialize.min.js"&gt;&lt;/script&gt;
    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"&gt;&lt;/script&gt;
  
    &lt;!-- scrolling change logo --&gt;
    &lt;script type="text/javascript" src="js/script.js"&gt;&lt;/script&gt;
  
    &lt;nav id="navbar"&gt;
  
  
      &lt;div class "container"&gt;
        &lt;a href="#!" class="brand-logo"&gt;
          &lt;img src="img/edizioni-black.png"&gt;
        &lt;/a&gt;
        &lt;a href="#" data-target="mobile-demo" class="sidenav-trigger"&gt;&lt;i class="material-icons"&gt;menu&lt;/i&gt;&lt;/a&gt;
        &lt;ul id="nav-mobile" class="right hide-on-med-and-down "&gt;
          &lt;li&gt;&lt;a class="color-font-menu" href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a class="color-font-menu" href="#"&gt;Blog&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a class="color-font-menu" href="#"&gt;Video&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a class="color-font-menu" href="#"&gt;About&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a class="color-font-menu" href="#"&gt;Contact&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a class="color-font-menu" href="#"&gt;Chi siamo&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;!-- end container --&gt;
  
    &lt;/nav&gt;
  
  
    &lt;ul class="sidenav " id="mobile-demo"&gt;
      &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Blog&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Video&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;About&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Contact&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Chi siamo&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  
    &lt;div class="container"&gt;
      &lt;div class="box orange"&gt;&lt;/div&gt;
      &lt;div class="box purple"&gt;&lt;/div&gt;
      &lt;div class="box blue"&gt;&lt;/div&gt;
      &lt;div class="box orange"&gt;&lt;/div&gt;
      &lt;div class="box blue"&gt;&lt;/div&gt;
    &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>