css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <!-- Gallery Slideshow-->
<ul class="gallery-slideshow">
  <li><img src="https://github.com/gaiaayan/CSS-jQuery-gallery-plugin/blob/master/demo-media/slide-1.jpg?raw=true"/></li>
  <li><img src="https://github.com/gaiaayan/CSS-jQuery-gallery-plugin/blob/master/demo-media/slide-2.jpg?raw=true"/></li>
  <li><img src="https://github.com/gaiaayan/CSS-jQuery-gallery-plugin/blob/master/demo-media/slide-3.jpg?raw=true"/></li>
  <li><img src="https://github.com/gaiaayan/CSS-jQuery-gallery-plugin/blob/master/demo-media/slide-4.jpg?raw=true"/></li>
  <li><img src="https://github.com/gaiaayan/CSS-jQuery-gallery-plugin/blob/master/demo-media/slide-5.jpg?raw=true"/></li>
  <li><img src="https://github.com/gaiaayan/CSS-jQuery-gallery-plugin/blob/master/demo-media/slide-6.jpg?raw=true"/></li>
              * {margin: 0; padding: 0;}/*just for better preview*/
ul.gallery-slideshow > img, ul {margin: 0; padding: 0;}
ul.gallery-slideshow {
  position: relative;
  list-style: none;
  background: #000000;
  overflow: hidden;
ul.gallery-slideshow li img {
  position: absolute;
  min-width: 100%; min-height: 100%;
/*gallery controls*/
  position: absolute; z-index: 1;
  top: 0; bottom: 0;
  width: 40px; height: 40px;
  background: rgba(0,0,0,0.8);
  margin: auto;
  cursor: pointer;
.gallery-control.prev { left: -5px; }
.gallery-control.next { right: -5px; }
.gallery-control.trigger {
  left: 0; right: 0;
  width: 50px; height: 50px;
  position: absolute;
  z-index: 2;
  top: 0; bottom: 0; left: 0; right: 0;
  margin: auto;
  content: "";
  width: 20px; height: 20px;
  box-sizing: border-box;
  border-style: solid;
  border-color: transparent;
.gallery-control.prev:after {
  border-width: 10px 15px 10px 0px;
  border-right-color: #ffffff;
.gallery-control.next:after {
  border-width: 10px 0px 10px 15px;
  border-left-color: #ffffff;
  border-style: double;
  border-width: 0px 0px 0px 20px;
  border-color: #ffffff;
  left: 5px;
  border-width: 10px 0px 10px 20px;
  border-left-color: #ffffff;
/*gallery navigation*/
ul.gallery-slideshow ul.gallery-navbar{
  position: absolute;
  bottom: 5%;
  width: 100%;
  text-align: center;
ul.gallery-navbar li{
  all: unset;
  position: relative;
  display: inline-block;
  width: 15px; height: 15px;
  background: rgba(255,255,255,0.5);
  margin: 10px;
  cursor: pointer;
ul.gallery-navbar li.active{ background: rgba(255,255,255,1); }
ul.gallery-navbar li:hover, .gallery-control:hover{ transform: scale(0.9); }
ul.gallery-navbar li:hover{ background: rgba(255,255,255,0.8); }
ul.gallery-navbar li:active, .gallery-control:active { transform: scale(0.8); }

 * CSS + jQuery Gallery Slideshow
 * Original author: @gaiaayan
 * Licensed under the MIT license
;(function ( $, window, document, undefined ) {

    function Slideshow(element, options) {
        //Variables declaration
        this.element = element;
        this.intervalID = null;
        this.current = 0;
        this.items = $(this.element).children();
        this.defaults = {
          interval: 2000,
          width: 500,
          height: 350
        //Merge configured options to defaults
        this.config = $.extend(this.defaults, options);
        //Initialize Slideshow

    Slideshow.prototype = {

        init: function() {
          //Set controls & config
          //Set event handler
          //Start animation
        setup: function() {
          //Append controls
          this.navBar = $('<ul>').addClass('gallery-navbar').appendTo(this.element);
            $('<li>').addClass(index === 0 ? 'active' : '').attr('data-nav','select').attr('data-index',index).appendTo(this.navBar);

          this.navPrev = $('<div>').addClass('gallery-control fade prev').attr('data-nav','prev').appendTo(this.element);
          this.navNext = $('<div>').addClass('gallery-control fade next').attr('data-nav','next').appendTo(this.element);

          this.trigger = $('<div>').addClass('gallery-control trigger fade pause').attr('data-nav','trigger').appendTo(this.element);

          //Hide controls

          //Modify defaults
          $(this.element).css('width', this.config.width).css('height', this.config.height);
        handleEvent: function() {
          //Click event
          //Detect what item is clicked inside the gallery
          $(this.element).on('click', function(event) {

            var dataNav = $(event.target).attr('data-nav');
            var dataIndex = $(event.target).attr('data-index');


              //Call functions depending on item clicked
              if(dataNav === 'trigger'){
                this.showItem(dataNav, dataIndex);

              //Style item


          //Mouseover/mouseout event
          $(this.element).on('mouseover', function() {

          $(this.element).on('mouseleave', function() {

        setTrigger: function() {
        start: function() {
          this.intervalID = setInterval(this.showItem.bind(this), this.config.interval);
        stop: function() {
          this.intervalID = null;
        setCurrent(nav,index) {
          switch(nav) {
            case 'select':
              this.current = index;
            case 'prev':
              this.current === 0 ? this.current = this.items.length-1 : this.current-- ;
            case 'next':
              this.current === this.items.length-1 ? this.current = 0 : this.current++ ;
        showItem: function(nav,index) {

    //Prevent  multiple instantiations
    $.fn.slideshow = function ( options ) {
      return this.each(function () {
        var instance = "plugin_jQuerySimpleGallerySlideshow";
        if (!$.data(this, instance)) {
            $.data(this, instance, new Slideshow( this, options ));

})( jQuery, window, document );

//Attach plugin to slideshow with ".gallery-slideshow" class
$(function() {
    interval: 2000,
    width: window.innerWidth,
    height: window.innerHeight
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................