cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <html>
  <head>
    <style>
      @import "https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.4.2/css/swiper.min.css";
    </style>
  </head>
  <body>
    <h1>My Photo Gallery</h1>
    <!-- Swiper -->
    <div class="swiper-container">
      <div class="swiper-wrapper">
        
        <div class="swiper-slide" id="1">
          <p>
            <img src="https://c1.staticflickr.com/2/1325/4601401297_3bc62d82bb.jpg">
          </p>
          <mark>
          <a href="https://flic.kr/p/81Boi8" target="_blank">Webb Telescope&#x27;s ISIM Structure Gets Cold-Tested</a><br />by <a href="https://www.flickr.com/photos/gsfc" target="_blank">NASA Goddard Space Flight Center</a>, on Flickr
          <a href="https://creativecommons.org/licenses/by/2.0/" target="_blank">CC License</a>
          </mark>
        </div>
        
        <div class="swiper-slide" id="2">
          <p>
            <img src="https://c1.staticflickr.com/5/4016/4616355132_3d8058db4e.jpg">
          </p>
          <mark>
          <a href="https://flic.kr/p/82W2xS" target="_blank">Oil Slick in the Gulf of Mexico May 17th View [Close Up]</a> <br />by <a href="https://www.flickr.com/photos/gsfc/" target="_blank">NASA Goddard Space Flight Center</a>, on Flickr
          <a href="https://creativecommons.org/licenses/by/2.0/" target="_blank">CC License</a>
          </mark>
        </div>
        
        <div class="swiper-slide" id="3">
          <p>
            <img src="https://c1.staticflickr.com/4/3393/4612673368_af4ec6e2f9.jpg">
          </p>
          <mark>
          <a href="https://flic.kr/p/82Ba6b" target="_blank">Ash plume from Eyjafjallajokull Volcano, Iceland May 16h View [detail]</a> <br />by <a href="https://www.flickr.com/photos/gsfc/" target="_blank">NASA Goddard Space Flight Center</a>, on Flickr
          <a href="https://creativecommons.org/licenses/by/2.0/" target="_blank">CC License</a>
          </mark>
        </div>
        
      </div>
      <!-- Add Pagination -->
      <div class="swiper-pagination"></div>
       <!-- Add Arrows -->
      <div class="swiper-button-next"></div>
      <div class="swiper-button-prev"></div>
    </div>
    
    <!-- holder for the fullscreen slider -->
    <div id="fullscreen-swiper"></div>
    <div id="fullscreen-swiper-backdrop"></div>
        
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.4.2/js/swiper.jquery.min.js"></script>
  </body>
</html>
            
          
!
            
              .swiper-slide {
  background: #ddf;
  min-height: 350px;
  padding-bottom: 30px;
  text-align: center;
}

.swiper-slide img {
  border: 1px solid #fff;
  cursor: pointer;
  max-width: 100%;
  max-height: 300px;
}

#fullscreen-swiper {
  display: none;
  height: 90vh;
  overflow: hidden;
  position: absolute;
  top: 5%;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
}

#fullscreen-swiper .swiper-slide {
  background: none; 
}

#fullscreen-swiper .swiper-slide img {
  height: 75vh;
  max-height: 650px;
}

#fullscreen-swiper-backdrop {
  background: #000;
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  
}
#fullscreen-swiper-close {
  border: 1px solid #fff;
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  padding: 1px 6px 0;
  position: absolute;
  top: 0;
  right: 15px;
  z-index: 10000;
}

.no-scroll {height: 100%; overflow: hidden}

/* 
  The styles below are optional, 
  they just make the example look better
*/
body {
  margin-top: 0; 
  font-family: Sans-Serif;
}

mark {
  background-color: #ccc;
  line-height: 20px;
  padding: 0 0.25em;
}

mark a {
  text-decoration: none;
}

#fullscreen-swiper .swiper-pagination-bullets {
  bottom: -2px;
}

#fullscreen-swiper .swiper-pagination-bullet {
  background: #fff;
  opacity: .5;
}

#fullscreen-swiper .swiper-pagination-bullet-active {
  background: #007aff;
}

            
          
!
            
              (function() {
  var swiper = new Swiper('.swiper-container', {
      pagination: '.swiper-pagination',
    	nextButton: '.swiper-button-next',
      prevButton: '.swiper-button-prev',
      slidesPerView: 2,
      centeredSlides: true,
      paginationClickable: true,
      spaceBetween: 10,
      loop: true,
  });
  
  $('.swiper-container .swiper-slide').on('click', function() {
    var slideId = $(this).attr('id');         
    openFullscreenSwiper(slideId);
  });
  
  function openFullscreenSwiper(initialSlideNumber) {
    var mainSwiperMarkup = $('.swiper-container').html(); 
    
    $('#fullscreen-swiper')
      .append(mainSwiperMarkup + "<div id='fullscreen-swiper-close'>X</div>")
      .fadeIn();
    
    var fullscreenSwiper = new Swiper('#fullscreen-swiper', {
      pagination: '.swiper-pagination',
      nextButton: '.swiper-button-next',
      prevButton: '.swiper-button-prev',
      slidesPerView: 1,
      centeredSlides: true,
      paginationClickable: true,
      spaceBetween: 10,
      loop: true,
      initialSlide: initialSlideNumber - 1,
    });      
    
    $('#fullscreen-swiper-backdrop').fadeIn();
    $('body, html').addClass('no-scroll');  

    $('#fullscreen-swiper-close').on('click', function() {
      $('#fullscreen-swiper').hide().empty();
      $('#fullscreen-swiper-backdrop').fadeOut();
      $('body, html').removeClass('no-scroll');
    });
  
  }

})();
            
          
!
999px
Loading ..................

Console