cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="accordion">
	<h4 class="accordion-toggle active"> This is an accordion <i class="fa fa-chevron-down"></i></h4>
	<div class="accordion-content default ">
		<p>TThis is a simple accordion implementation, that's uses minimal markup and roughly 8 lines of jQuery.  It can be easily hacked to use different behavior.  Chevrons are font awesome but easily replaced with anything.
		</p>
	</div>
	<h4 class="accordion-toggle ">Another Tab <i class="fa fa-chevron-down"></i></h4>
	<div class="accordion-content">
		<p>This is a play on an ultra lightweight accordion menu.</p>
	</div>

	<h4 class="accordion-toggle">News Releases <i class="fa fa-chevron-down"></i></h4>
	<div class="accordion-content" >
		<p>Vivamus facilisisnibh scelerisque laoreet.</p>
	</div>
</div>
            
          
!
            
              //Used on contact page
$orange: #f8580a;
.accordion {
	background-color: $orange;
	margin-top: 20px;
	margin-bottom:20px;
	i {
		position: absolute;
		right: 10px;
		&:before {

			display: inline-block;
			-ms-transform-origin: 50% 35%;
			-webkit-transform-origin: 50% 35%;
			-moz-transform-origin: 50% 35%;
			transform-origin: 50% 35%;
			-webkit-transition-timing-function: ease-in-out; /* Safari and Chrome */
			transition-timing-function: ease-in-out;
			-webkit-transform-style: preserve-3d;
			-moz-transform-style: preserve-3d;
			transform-style: preserve-3d;
			-webkit-transition: all 0.3s;
			-moz-transition: all 0.3s;
			transition: all 0.3s;
			 transform: rotateZ(0deg);
			 transform-origin: 50% 50%;
			-moz-transform: rotateZ(0deg);
			-webkit-transform: rotateZ(0deg);
			-o-transform: rotateZ(0deg);
			-ms-transform: rotateZ(0deg);
		}
	}
	h4 {
		color: white;
		position: relative;
		background-color: $orange;
		padding: 10px;
		border-bottom: 1px solid #444;
		margin:0;
		line-height: 1em;
		font-size: 16px;
		text-transform: uppercase;
		&:hover {
			background-color: lighten($orange, 20%)
		}
	}
	h4.active {
		background-color: $orange;
		i:before {
			 transform: rotateZ(180deg);
            -moz-transform: rotateZ(180deg);
            -webkit-transform: rotateZ(180deg);
            -o-transform: rotateZ(180deg);
            -ms-transform: rotateZ(180deg);
		}
	}
}

.accordion-toggle {
	cursor: pointer;
}

.accordion-content {
	padding: 14px;
	display: none;
	background-color: white;
	&.default {
		display: block;
	}
}
body {
	background: #444;
}
            
          
!
            
              (function(jQuery) {
	"use strict";
	var Engine;
	jQuery(document).ready(function() {
		Engine = {
			ui: {
				accordion: function() {

					/*==============================
					   Accordion functionality f
					===============================*/

					$('.accordion').find('.accordion-toggle').click(function() {
						//Expand or collapse this panel
						$(this).next().slideToggle('fast');
						if (!$(this).hasClass("active")) {
							$('.accordion h4').removeClass('active');
							$(this).addClass('active');
						} else {
							$('.accordion h4').removeClass('active');
						}
						$(".accordion-content").not($(this).next()).slideUp('fast');

					});
				}
			} // ui
		}; // Engine
		Engine.ui.accordion();
	});
}(jQuery));
            
          
!
999px
Loading ..................

Console