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

              
                

	<div id="page-wrap">
		
	
		
		<div class="info-col">
		  		<dl>
    		  <dt id="starter">First</dt>
    		  <dd>Text here</dd>
    		  <dt class="a1">Second</dt>
    		  <dd>Text here</dd>
    		  <dt class="a1">Third</dt>
    		  <dd>Text here</dd>
    		</dl>
		
		</div>
		
			
	</div>
	
    <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script>

              
            
!

CSS

              
                * { margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #141414; }
body { font: 14px Georgia, serif; }
#page-wrap { width: 960px; padding: 0 0 0 15px; margin: 0 auto; overflow: hidden; height: 100%; }

.info-col { float: left; width: 132px; height: 100%; padding: 50px 0 0 0; }
.info-col h2 { text-align: right; font-weight: normal; padding: 25px 25px 25px 25px ; }

.image { height: 100px; text-indent: -9999px; display: block;  }



dt { padding: 25px; background: #900; color: white; border-bottom: 1px solid grey; }
dt:nth-of-type(1):hover { padding: 5px; background: #282828; color: #eeeeee; border-bottom: 1px solid grey;}
dd { position: absolute; left: -9999px; top: -9999px; width: 880px; background: #900; padding: 10px; color: grey;}
dt:active{color:red}
dt:nth-of-type(1) { background: #3b3b3b; }
dd:nth-of-type(1) { background: #3b3b3b; }

dt:nth-of-type(2) { background: #282828; }
dd:nth-of-type(2) { background: #282828; }

dt:nth-of-type(3) { background: #282828; }
dd:nth-of-type(3) { background: #282828; }

dt:nth-of-type(4) { background: #282828; }
dd:nth-of-type(4) { background: #282828; }

dt:nth-of-type(5) { background: #282828; }
dd:nth-of-type(5) { background: #282828; }

dt:nth-of-type(6) { background: #282828; border-bottom: 1px solid #282828;  }
dd:nth-of-type(6) { background: #282828; }

.curCol { -moz-box-shadow: 0 0 10px rgba(0,0,0,0.2); -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.2); z-index: 1; position: relative; }
              
            
!

JS

              
                $(function() {

    // Set up variables
    var $el, $parentWrap, $otherWrap, 
        $allTitles = $("dt").css({
            padding: 5, // setting the padding here prevents a weird situation, where it would start animating at 0 padding instead of 5
            "cursor": "pointer" // make it seem clickable
        }),
        $allCells = $("dd").css({
            position: "relative",
            top: -1,
            left: 0,
            display: "none" // info cells are just kicked off the page with CSS (for accessibility)
        });
    
    // clicking image of inactive column just opens column, doesn't go to link   
    $("#page-wrap").delegate("a.image","click", function(e) { 
        
        if ( !$(this).parent().hasClass("curCol") ) {         
            e.preventDefault(); 
            $(this).next().find('dt:first').click(); 
        } 
        
    });
    
    // clicking on titles does stuff
    $("#page-wrap").delegate("dt", "click", function() {
        
        // cache this, as always, is good form
        $el = $(this);
        
        // if this is already the active cell, don't do anything
        if (!$el.hasClass("current")) {
        
            $parentWrap = $el.parent().parent();
            $otherWraps = $(".info-col").not($parentWrap);
            
            // remove current cell from selection of all cells
            $allTitles = $("dt").not(this);
            
            // close all info cells
            $allCells.slideUp();
            
            // return all titles (except current one) to normal size
            $allTitles.animate({
                fontSize: "24px",
                paddingTop: 10,
                paddingRight: 10,
                paddingBottom: 10,
                paddingLeft: 10
            });
            
            // animate current title to larger size            
            $el.animate({
                "font-size": "30px",
                paddingTop: 10,
                paddingRight: 5,
                paddingBottom: 0,
                paddingLeft: 10
            }).next().slideDown();
            
            // make the current column the large size
            $parentWrap.animate({
                width: 900
            }).addClass("curCol");
            
            // make other columns the small size
            $otherWraps.animate({
                width: 800
            }).removeClass("curCol");
            
            // make sure the correct column is current
            $allTitles.removeClass("current");
            $el.addClass("current");  
        
        }
        
    });
    
    $("#starter").trigger("click");
    
});
              
            
!
999px

Console