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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <h2>fancybox v3.5 - Using trigger element</h2>

<p>
  Sometimes you might need to start fancybox from different element - simply use <code>data-fancybox-trigger</code> attribute with the value of fancybox group name.
  This allows to avoid content duplication in the gallery. For example, start fancybox when clicking on featured image. <br />
  Optionally, use <code>data-fancybox-index</code> attribute to specify <a href="javascript:;" data-fancybox-trigger="preview" data-fancybox-index="3">index of starting element</a>.
</p>

<hr class="my-5" />

<p class="imglist" style="max-width: 520px;">
  <a data-fancybox-trigger="preview" href="javascript:;">
    <img src="https://source.unsplash.com/LuK-MuZ-yf0/510x340" />
  </a>

  <a href="https://source.unsplash.com/LuK-MuZ-yf0/1500x1000" data-fancybox="preview" data-width="1500" data-height="1000">
    <img src="https://source.unsplash.com/LuK-MuZ-yf0/120x80" />
  </a>

  <a href="https://source.unsplash.com/Oaqk7qqNh_c/1500x1000" data-fancybox="preview" data-width="1500" data-height="1000">
    <img src="https://source.unsplash.com/Oaqk7qqNh_c/120x80" />
  </a>
  
  <a href="https://source.unsplash.com/X9GHkHbJIaU/1500x1000" data-fancybox="preview" data-width="1500" data-height="1000">
    <img src="https://source.unsplash.com/X9GHkHbJIaU/120x80" />
  </a>
  
  <a href="https://source.unsplash.com/9c_djeQTDyY/1500x1000" data-fancybox="preview" data-width="1500" data-height="1000">
    <img src="https://source.unsplash.com/9c_djeQTDyY/120x80" />
  </a>
</a>
              
            
!

CSS

              
                
              
            
!

JS

              
                $('[data-fancybox="preview"]').fancybox({
  thumbs : {
    autoStart : true
  }
});
              
            
!
999px

Console