title: Hiding the back button in material carousel
body: <p>I have a material css carousel, where I need to Hide the back button in the first slide. I have tried with the bewlo code from the post</p>
  
  <p>The below code will stop the user from loop</p>
  
  <p><a href="https://stackoverflow.com/questions/47483182/stop-looping-in-carousel-materializecss">Stop looping in Carousel materializecss</a></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>$('.carousel').carousel({fullWidth: true});
   
   function forward(){
    if ($('.carousel-item.active').next().is('.carousel-item')) {
       $('.carousel').carousel('next');
     } else {
      alert('last');
     }
   }
   function backward(){
    if ($('.carousel-slider .carousel-item').first().is('.active')) {
      alert('first')
    } else {
      $('.carousel').carousel('prev');
    }
   }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css"&gt;
  &lt;script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"&gt;&lt;/script&gt;
  
   &lt;div class="carousel carousel-slider center" data-indicators="true"&gt;
      &lt;div class="carousel-fixed-item center"&gt;
        &lt;a class="btn waves-effect white grey-text darken-text-2"&gt;button&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="carousel-item red white-text" href="#one!"&gt;
        &lt;h2&gt;First Panel&lt;/h2&gt;
        &lt;p class="white-text"&gt;This is your first panel&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="carousel-item amber white-text" href="#two!"&gt;
        &lt;h2&gt;Second Panel&lt;/h2&gt;
        &lt;p class="white-text"&gt;This is your second panel&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="carousel-item green white-text" href="#three!"&gt;
        &lt;h2&gt;Third Panel&lt;/h2&gt;
        &lt;p class="white-text"&gt;This is your third panel&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="carousel-item blue white-text" href="#four!"&gt;
        &lt;h2&gt;Fourth Panel&lt;/h2&gt;
        &lt;p class="white-text"&gt;This is your fourth panel&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    
    &lt;nav&gt;
      &lt;div class="nav-wrapper grey darken-2"&gt;
        &lt;ul class="left"&gt;
          &lt;li&gt;&lt;a onclick="backward()"&gt;Back&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a onclick="forward();"&gt;Next&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    &lt;/nav&gt;</code></pre>
  </div>
  </div>
  </p>