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 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

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.

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="gallery">
  <div class="gallery-cell"><img src="https://cdn.dribbble.com/users/146798/screenshots/6345235/rainbow-dribbble_4x.jpg" alt="" /></div>
  <div class="gallery-cell"><img src="https://cdn.dribbble.com/users/146798/screenshots/6345235/rainbow-dribbble_4x.jpg" alt="" /></div>
  <div class="gallery-cell"><img src="https://cdn.dribbble.com/users/146798/screenshots/6345235/rainbow-dribbble_4x.jpg" alt="" /></div>
  <div class="gallery-cell"><img src="https://cdn.dribbble.com/users/146798/screenshots/6345235/rainbow-dribbble_4x.jpg" alt="" /></div>
</div>

<div class="container">
  <div class="row">
    <div class="col-sm-12">
      <h1 class="text-center"><a href="https://flickity.metafizzy.co/">Flickity by Metafizzy</a></h1>
      <p class="text-center"><a href="https://dribbble.com/alexgriendling">Images created by Alex Griendling on Dribbble</a></p>
    </div>
  </div>
</div>

              
            
!

CSS

              
                .gallery {
  width: 100%; /* full width */
  height: 500px;
  background: #3b2049;
  
  .gallery-cell {
    height: 100%;
    width: auto;
    img {
      height: 100%;
    }
  }
}
/* position dots in gallery */
.flickity-page-dots {
  bottom: 12px;
}
/* white circles */
.flickity-page-dots .dot {
  width: 12px;
  height: 12px;
  opacity: 1;
  background: transparent;
  border: 2px solid white;
}
/* fill-in selected dot */
.flickity-page-dots .dot.is-selected {
  background: white;
}





              
            
!

JS

              
                var flky = new Flickity( '.gallery', {
  // options, defaults listed

  accessibility: true,
  // enable keyboard navigation, pressing left & right keys

  autoPlay: 3000,
  // advances to the next cell
  // if true, default is 3 seconds
  // or set time between advances in milliseconds
  // i.e. `autoPlay: 1000` will advance every 1 second

  cellAlign: 'center',
  // alignment of cells, 'center', 'left', or 'right'
  // or a decimal 0-1, 0 is beginning (left) of container, 1 is end (right)

  cellSelector: undefined,
  // specify selector for cell elements

  contain: false,
  // will contain cells to container
  // so no excess scroll at beginning or end
  // has no effect if wrapAround is enabled

  draggable: true,
  // enables dragging & flicking

  freeScroll: false,
  // enables content to be freely scrolled and flicked
  // without aligning cells

  friction: 0.2,
  // smaller number = easier to flick farther

  initialIndex: 0,
  // zero-based index of the initial selected cell

  percentPosition: true,
  // sets positioning in percent values, rather than pixels
  // Enable if items have percent widths
  // Disable if items have pixel widths, like images

  prevNextButtons: true,
  // creates and enables buttons to click to previous & next cells

  pageDots: true,
  // create and enable page dots

  resize: true,
  // listens to window resize events to adjust size & positions

  rightToLeft: false,
  // enables right-to-left layout

  setGallerySize: true,
  // sets the height of gallery
  // disable if gallery already has height set with CSS

  watchCSS: false,
  // watches the content of :after of the element
  // activates if #element:after { content: 'flickity' }
  // IE8 and Android 2.3 do not support watching :after
  // set watch: 'fallbackOn' to enable for these browsers

  wrapAround: true
  // at end of cells, wraps-around to first for infinite scrolling

});
              
            
!
999px

Console