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="row" style="margin-top: 2em;">
  <div class="large-12 columns">

   <h3>From Busch II to Busch III</h3>

<div id="cf7" class="shadow">
  <img class='opaque' src="http://nbierma.com/stadiums/images/busch/busch-2002.jpg" />
  <img src="http://nbierma.com/stadiums/images/busch/busch-2005.jpg" />
  <img src="http://nbierma.com/stadiums/images/busch/busch-2006.jpg" />
  <img src="http://nbierma.com/stadiums/images/busch/busch-2010.jpg" />
  <img src="http://nbierma.com/stadiums/images/busch/busch-2015.jpg" />
  <img src="http://nbierma.com/stadiums/images/busch/busch-both.jpg" />
    </div>
<p id="cf7_controls" style="margin-top:80px">
  <button class="selected">2002</button>
  <button>2005</button>
  <button>2006</button>
  <button>2010</button>
  <button>2015</button>
  <button>Both</button>
</p>

    <p>&nbsp;</p>

  </div>
<p id="botgraf"><small>All images from Google Maps or Google Earth unless otherwise credited. Before/after cross-fade effect by <a href="http://css3.bradshawenterprises.com/cfimg/">Rich Bradshaw</a>.</small></p>
</div>
              
            
!

CSS

              
                p#cf7_controls {
  text-align:center;
}
#cf7_controls span {
  padding-right:2em;
  cursor:pointer; 
}
#cf7 {
  position:relative;
  height:281px;
  width:430px;
  margin:0 auto 10px;
}
#cf7 img {
  position:absolute;
  left:0;
  -webkit-transition: opacity 1s ease-in-out;
  -moz-transition: opacity 1s ease-in-out;
  -o-transition: opacity 1s ease-in-out;
  transition: opacity 1s ease-in-out;
  opacity:0;
  -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  filter: alpha(opacity=0);
}

#cf7 img.opaque {
  opacity:1;
  -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
  filter: alpha(opacity=1);
}

/* custom css */
body {font-family: "Helvetica Neue","Helvetica",Helvetica,Arial,sans-serif;}
#topline {margin-top:10px}
#botline {margin:40px auto 20px auto}
#botgraf {margin-top:40px;}
small {font-size:10px}
button {padding:4px 8px; font-size:16px}

.shot, h3, p  {
  max-width:430px; margin-left: auto; margin-right:auto
}

              
            
!

JS

              
                $(document).ready(function() {
  $("#cf7_controls").on('click', 'button', function() {
    $("#cf7 img").removeClass("opaque");

    var newImage = $(this).index();

    $("#cf7 img").eq(newImage).addClass("opaque");

    $("#cf7_controls button").removeClass("selected");
    $(this).addClass("selected");
  });
});
              
            
!
999px

Console