Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

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.

HTML

              
                <div class="container">
  <div class="timer"></div>
  <div class="slideshow">
    <div class="slide">Squares</div>
    <div class="slide">3x3</div>
    <div class="slide">3x3=9</div>
    <div class="slide">4x4</div>
    <div class="slide">4x4=16</div>
    <div class="slide">6x6</div>
    <div class="slide">6x6=36</div>
    <div class="slide">7x7</div>
    <div class="slide">7x7=49</div>
    <div class="slide">8x8</div>
    <div class="slide">8x8=64</div>
    <div class="slide">9x9</div>
    <div class="slide">9x9=81</div>
    <div class="slide">4s & 8s</div>
    <div class="slide">4x3</div>
    <div class="slide">4x3=12</div>
    <div class="slide">8x3</div>
    <div class="slide">8x3=24</div>
    <div class="slide">4x6</div>
    <div class="slide">4x6=24</div>
    <div class="slide">8x6</div>
    <div class="slide">8x6=48</div>
     <div class="slide">4x7</div>
    <div class="slide">4x7=28</div>
     <div class="slide">8x7</div>
    <div class="slide">8x7=56</div>
    <div class="slide">4x8</div>
    <div class="slide">4x8=32</div>
     <div class="slide">4x9</div>
    <div class="slide">4x9=36</div>
     <div class="slide">8x9</div>
    <div class="slide">8x9=72</div>
    <div class="slide">3s,6s,9s</div>
     <div class="slide">3x6</div>
    <div class="slide">3x6=18</div>
     <div class="slide">3x7</div>
    <div class="slide">3x7=21</div>
     <div class="slide">6x7</div>
    <div class="slide">6x7=42</div>
     <div class="slide">3x9</div>
    <div class="slide">3x9=27</div>
     <div class="slide">6x9</div>
    <div class="slide">6x9=54</div>
    <div class="slide">9x7</div>
    <div class="slide">9x7=63</div>
    
  </div>
</div>
              
            
!

CSS

              
                html, body {
  margin: 0;
  padding: 0;
  font-family: Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
.container {
  border: 1px solid #575757;
  width: 100%;
  height: 320px;
  overflow: hidden;
  position: absolute;
}
.timer {
  height: 1%;
  width: 0%;
  position: absolute;
  left: 0;
  bottom: 0;
  background: #09f;
  z-index: 10;
}
.slideshow {
  position: relative;
  height: 100%;
}
.slide {
  width: 100%;
  height: 100%;
  background: #00BFFF;
  color:#ddd;
  text-align: center;
  line-height: 320px;
  font-size: 220px;
  }

 .slide { display: none;}
              
            
!

JS

              
                /* Slider (work in progress)
 * 03/09/2015 by Andrew Errico
 */
$(function() {

    // slider type
    $t = "slide"; // opitions are fade and slide
    
  	//variables
    $f = 1000,  // fade in/out speed
    $s = 1000,  // slide transition speed (for sliding carousel)
    $d = 5000;  // duration per slide
    
    $n = $('.slide').length; //number of slides
    $w = $('.slide').width(); // slide width
  	$c = $('.container').width(); // container width
   	$ss = $n * $w; // slideshow width
  
  	
      function timer() {
        $('.timer').animate({"width":$w}, $d);
        $('.timer').animate({"width":0}, 0);
    }

  
  // fading function
    function fadeInOut() {
      timer();
        $i = 0;    
        var setCSS = {
            'position' : 'absolute',
            'top' : '0',
            'left' : '0'
        }        
        
        $('.slide').css(setCSS);
        
        //show first item
        $('.slide').eq($i).show();
        

        setInterval(function() {
          timer();
            $('.slide').eq($i).fadeOut($f);
            if ($i == $n - 1) {
                $i = 0;
            } else {
                $i++;
            }
            $('.slide').eq($i).fadeIn($f, function() {
                $('.timer').css({'width' : '0'});
            });

        }, $d);
        
    }
    
    function slide() {
      timer();
        var setSlideCSS = {
            'float' : 'left',
            'display' : 'inline-block',
          	'width' : $c
        }
        var setSlideShowCSS = {
            'width' : $ss // set width of slideshow container
        }
        $('.slide').css(setSlideCSS);
        $('.slideshow').css(setSlideShowCSS); 
        
        
        setInterval(function() {
            timer();
            $('.slideshow').animate({"left": -$w}, $s, function(){
                // to create infinite loop
                $('.slideshow').css('left',0).append( $('.slide:first'));
            });
        }, $d);
        
    }
    
    if ($t == "fade") {
        fadeInOut();
        
    } if ($t == "slide") {
        slide();
        
    } else {
      
    }
});
              
            
!
999px

Console