title: Slideshow picture disappears
body: <p>I have a CSS + Javascripts slideshow, taken from the <a href="http://www.w3schools.com/howto/howto_js_slideshow.asp" rel="nofollow">W3Schools website example</a>.</p>
  
  <p>This is the code, adapted to my web aplication (almost the same):</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    var slideIndex = 1;
  
    function showSlides(n) {
      var slides = $(".mySlides");
      var i;
  
      if (n &gt; slides.length) {
        slideIndex = 1;
      }
  
      if (n &lt; 1) {
        slideIndex = slides.length;
      }
  
      for (i = 0; i &lt; slides.length; i++) {
        slides[i].style.display = "none";
      }
  
      slides[slideIndex - 1].style.display = "block";
    }
  
    function plusSlides(n) {
      showSlides(slideIndex += n);
    }
  
    showSlides(slideIndex);
  
    $(".prev").click(function() {
      plusSlides(-1);
    });
  
    $(".next").click(function() {
      plusSlides(1);
    });
  
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>@-webkit-keyframes fade {
    from {
      opacity: .4
    }
    to {
      opacity: 1
    }
  }
  @keyframes fade {
    from {
      opacity: .4
    }
    to {
      opacity: 1
    }
  }
  .slideshow-container {
    position: relative;
    margin: auto;
  }
  .prev,
  .next {
    cursor: pointer;
    position: absolute;
    top: 0;
    top: 50%;
    width: auto;
    margin-top: -22px;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 1.6s ease;
    border-radius: 0 3px 3px 0;
  }
  .next {
    right: 0;
    border-radius: 3px 0 0 3px;
  }
  .prev:hover,
  .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
  }
  .text {
    color: #f2f2f2;
    font-size: 15px;
    padding: 8px 12px;
    position: absolute;
    bottom: 8px;
    width: 100%;
    text-align: center;
  }
  .numbertext {
    color: #f2f2f2;
    font-size: 12px;
    padding: 8px 12px;
    position: absolute;
    top: 0;
  }
  .fade {
    -webkit-animation-name: fade;
    -webkit-animation-duration: 1.5s;
    animation-name: fade;
    animation-duration: 1.5s;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="slideshow-container"&gt;
    &lt;div class="mySlides fade"&gt;
      &lt;div class="numbertext"&gt;1 / 3&lt;/div&gt;
      &lt;img class="img-responsive" src="pic1.jpg" alt='Entrada'&gt;
      &lt;div class="text"&gt;1&lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="mySlides fade"&gt;
      &lt;div class="numbertext"&gt;2 / 3&lt;/div&gt;
      &lt;img class="img-responsive" src="pic2.jpg"&gt;
      &lt;div class="text"&gt;2&lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="mySlides fade"&gt;
      &lt;div class="numbertext"&gt;3 / 3&lt;/div&gt;
      &lt;img class="img-responsive" src="pic3.jpg"&gt;
      &lt;div class="text"&gt;3&lt;/div&gt;
    &lt;/div&gt;
  
    &lt;a class="prev"&gt;&amp;#10094;&lt;/a&gt;
    &lt;a class="next"&gt;&amp;#10095;&lt;/a&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The page loads correctly, but the pictures disapear after a second or so.</p>
  
  <p>How can I fix it?</p>