Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                 <div class="slide-content">
        <div class="mySlides">
            <img src="https://www.naturespicsonline.com/system/carousel_image/file/199/8.jpg" style="width:100%">
        </div>
        <div class="mySlides">
            <img src="https://www.naturespicsonline.com/system/carousel_image/file/202/50.jpg" style="width:100%">
        </div>
        <div class="mySlides">
            <img src="https://www.naturespicsonline.com/system/carousel_image/file/206/69.jpg" style="width:100%">
        </div>
        <div class="mySlides">
            <img src="https://www.naturespicsonline.com/system/carousel_image/file/205/71.jpg" style="width:100%">
        </div>
        <a class="arrow arrow-left" id="arrow-left"></a>
        <a class="arrow arrow-right" id="arrow-right"></a>
        <div class="thumbnail">
            <div class="column">
                <img class="demo cursor" src="https://www.naturespicsonline.com/system/carousel_image/file/199/8.jpg" style="width:100%"data-slide="0" alt="The Woods">
            </div>
            <div class="column">
                <img class="demo cursor" src="https://www.naturespicsonline.com/system/carousel_image/file/202/50.jpg" style="width:100%" data-slide="1"   alt="Trolltunga, Norway">
            </div>
            <div class="column">
                <img class="demo cursor" src="https://www.naturespicsonline.com/system/carousel_image/file/206/69.jpg" style="width:100%"   data-slide="2" alt="Mountains and fjords">
            </div>
            <div class="column">
                <img class="demo cursor" src="https://www.naturespicsonline.com/system/carousel_image/file/205/71.jpg" style="width:100%"  data-slide="3" alt="Mountains and fjords">
            </div>
        </div>
    </div>


              
            
!

CSS

              
                   * {
  		box-sizing: border-box;
  		margin:0;
  		padding:0;
		}

		img {
		  vertical-align: middle;
		      width: 100%;
    height: 100%;
		}
    .mySlides {
        width: 100%;
        display:none;
         min-height:300px;
         height:90vh;
    }
	.slide-content {
		 position: relative;
  margin: 0;
   padding: 0;
   font-family: Arial, Helvetica, sans-serif;
   width: 100%;
  
   height:100vh;
	}
    .arrow {
        cursor: pointer;
        position: absolute;
        top: 50%;
        margin-top: -35px;
        width: 0;
        height: 0;
        border-style: solid;
    }

    .arrow-left {
        border-width: 30px 40px 30px 0;
        border-color: transparent #fff transparent transparent;
        left: 0;
        margin-left: 30px;
    }

    .arrow-right {
        border-width: 30px 0 30px 40px;
        border-color: transparent transparent transparent #fff;
        right: 0;
        margin-right: 30px;
    }

    .thumbnail {
        display: flex;
    }

    .column {
        flex: 1;
    }

    .column img {
        width: 100%;
        height: 100%;
    }

    .demo {
        opacity: 0.6;
    }

    .demo:hover,
    .active {
        opacity: 1;
    }
              
            
!

JS

              
                   var strIndex = 0;
    var slides = document.querySelectorAll(".mySlides");
    var demo = document.querySelectorAll(".demo");

    var leftarr = document.getElementById("arrow-left");
    var rightarr = document.getElementById("arrow-right");
    leftarr.addEventListener("click", function() {
        arrSlides(-1);
    });


demo.forEach(function (element){
  element.addEventListener("click", function(){
    var note = element.getAttribute('data-slide');
        currentSlide(parseInt(note));
  });
});

  

    rightarr.addEventListener("click", function() { arrSlides(1) });

    function reset() {
        for (let i = 0; i < slides.length; i++) {
            slides[i].style.display = "none";
        }
        for (i = 0; i < demo.length; i++) {
            demo[i].className = demo[i].className.replace(" active", "");
        }
    }

    function arrSlides(n) {
        slideShow(strIndex += n);
    }

    function currentSlide(n) {
        slideShow(strIndex = n);
    }

    function slideShow(n) {
        reset();
        var lengt = slides.length - 1;
        if (n < 0) { strIndex = lengt }
        if (n > lengt ) { strIndex = 0 }
        slides[strIndex].style.display = "block";
        demo[strIndex].classList += " active";
    }

slideShow();
              
            
!
999px

Console