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

              
                			<header>							
  <h1>Effects Select<span> for the Options / Transform</span></h1>			
</header>
<section class="container">
			  <div class="main clearfix">
					    <select id="selection" class="select">
						      <option value="-1" selected class="fa fa-bars">Main</option>
						      <option value="1" class="fa fa-user"> User</option>
						      <option value="2" class="fa fa-newspaper-o"> Messages</option>
						      <option value="3" class="fa fa-calendar"> Events</option>
						      <option value="4" class="fa fa-envelope-o"> Messages</option>
						      <option value="5" class="fa fa-gear"> Settings</option>
						      <option value="6" class="fa fa-info-circle"> Help</option>
					    </select>
				  </div>
</section>
<footer>
  <h4>Thank You</h4>
  <p>Made <a href="https://twitter.com/roswellparian" target="_blank">@roswellparian</a> by Parian</p>
</footer>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Lato:300,400,700);
@import url(https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css);

*,*:after,*:before {
	-webkit-box-sizing: border-box;
	   -moz-box-sizing: border-box;
	        box-sizing: border-box;
	padding: 0;
	margin: 0;
}
.clearfix:before,.clearfix:after {
	content: " ";
	display: table;
}
.clearfix:after {clear: both;}
.clearfix {*zoom: 1;}
body {
	font-family: 'Lato', Calibri, Arial, sans-serif;
	background: #364859;
	font-weight: 400;
	font-size: 15px;
	color: #FFF;
  height: initial;
  width: initial;
}
a {
	color: #09F;
  padding: 0 0 2px;
	text-decoration: none;
}
a:hover {
  border-bottom: 1px solid;
}
header {
  overflow: hidden;
	padding: 40px 10px 50px !important;
	margin-bottom: 30px;
}
header h1 {
	font-size: 34px;
	line-height: 38px;
	margin: 0;
	font-weight: 700;
	color: #FFF;
}
header h1 span {
	display: block;
	font-size: 20px;
	font-weight: 400;
}
footer, header, section {
  height: auto;
  margin: 0 auto;
  padding: 0;
  position: relative;
  text-align: center;
}
footer {
  overflow: hidden;
  padding: 40px 10px;
  -webkit-transition: all .25s ease-in-out;
     -moz-transition: all .25s ease-in-out;
          transition: all .25s ease-in-out;
}
footer > h4 {
  font-size: 3em;
}
footer > p {
  font-size: 1em;
  font-weight: 400;
}
.container {
	width: 100%;
	position: relative;
}
.main, .container {
	width: initial;
	margin: 0 auto;
	position: relative;
	padding: 0;
}
.main p {
	color: #AAA;
	padding: 20px 30px 0px 0px;
	font-size: 20px;
	line-height: 34px;
	font-weight: 400;
	text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

/*---------------------------------
/* Css
/*--------------------------------*/
.action, .select {
	position: relative;
	width: 280px;
	margin: 20px auto;
  padding: 0 0 20px;
	display: block;
  text-align: start;
  -webkit-transition: all .25s ease-in-out;
     -moz-transition: all .25s ease-in-out;
          transition: all .25s ease-in-out;
}
.action > span {
  background: #08F;
	width: 100%;
	height: 40px;
	line-height: 40px;
	color: #FFF;
	font-weight: 700;
	font-size: 16px;
	display: block;
	padding: 0 50px 0 20px;
	position: relative;
	cursor: pointer;
}
.action > span:after {
	content: '\25BC';
	position: absolute;
	right: 0px;
	top: 15%;
	width: 50px;
	text-align: center;
	font-size: 12px;
	padding: 0;
	height: 70%;
	line-height: 28px;
	border-left: 1px solid rgba(0,0,0,.2);
}
.action > span > span.fa {
  padding: 0 5px 0 26px !important;
}
.action.active > span:after {	content: '\25B2';}
.action ul {
	list-style-type: none;
	margin: 0;
	padding: 0;
	display: block;
	position: relative;
}
.action ul li {display: block;}
.action ul li span {
	width: 100%;
	background: #08F;
	line-height: 40px;
	padding: 0 30px 0 70px;
	display: block;
	color: #FFF;
	cursor: pointer;
	font-weight: 700;
}
.action > span,.action ul li span {
	-webkit-backface-visibility: hidden;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	 -khtml-user-select: none;
	   -moz-user-select: none;
	        user-select: none;
}
.action span.fa[class^="fa-"], .action span.fa[class*=" fa-"]:before {
  font-size: 18px;
  margin: 0 14px 0 -24px;
}
.action span.fa[class^="fa-"], .action span.fa[class*=" fa-"] {
  font-size: 13px;
  padding: 0 30px 0 45px;
}
.cd-select {	border: 1px solid #ddd;}
.action > span,.action ul li:nth-last-child(-n+3) span {
	box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}
.action ul {
	position: absolute;
	top: 0px;
	width: 100%;
}
.action ul li {
	position: absolute;
	width: 100%;
}
.active.action > span {	color: rgba(0,0,0,.35);}
.active.action > span,.active.action ul li span {
	box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}
.active.action ul li span {
	-webkit-transition: all 0.2s linear 0s;
	   -moz-transition: all 0.2s linear 0s;
	        transition: all 0.2s linear 0s;
}
.active.action ul li span:hover {
	background: #4DA;
	color: #fff;
}
              
            
!

JS

              
                ;( function( $, window, undefined ) {
	'use strict';
	$.DropDown = function( options, element ) {
		this.$el = $(element);
		this._init(options);
	};

	// the options
	$.DropDown.defaults = {
		speed : 300,	easing : 'ease',
		gutter : 0,	stack : true,
		delay : 0,	random : false,
		rotated : false,	slidingIn : false,
		onOptionSelect : function(opt) {return false;}
	};
	$.DropDown.prototype = {
		_init : function( options ) {
			// options
			this.options = $.extend( true, {}, $.DropDown.defaults, options );
			this._layout();
			this._initEvents();
		},
		_layout : function() {
			var self = this;
			this.minZIndex = 1000;
			this._transformSelect();
			this.opts = this.listopts.children( 'li' );
			this.optsCount = this.opts.length;
			this.size = { width : this.dd.width(), height : this.dd.height() };			
			var elName = this.$el.attr( 'name' ), elId = this.$el.attr('id'),
				inputName = elName !== undefined ? elName : elId !== undefined?elId:'selection-'+(new Date()).getTime();
			this.inputEl = $( '<input type="hidden" name="' + inputName + '"></input>').insertAfter(this.selectlabel);			
			this.selectlabel.css('z-index', this.minZIndex + this.optsCount);
			this._positionOpts();
			if( Modernizr.csstransitions ) {
				setTimeout( function() { self.opts.css('transition', 'all ' + self.options.speed + 'ms ' + self.options.easing ); }, 25 );
			}
		},
		_transformSelect : function() {
			var optshtml = '', selectlabel = '';
			this.$el.children( 'option' ).each( function() {
				var $this = $( this ),
					val = isNaN( $this.attr( 'value' ) ) ? $this.attr( 'value' ) : Number( $this.attr( 'value' ) ) ,
					classes = $this.attr( 'class' ),
					label = $this.text();
				val !== -1 ?
					classes !== undefined ?
						optshtml += '<li data-value="' + val + '"><span class="' + classes + '">' + label + '</span></li>':
						optshtml += '<li data-value="' + val + '"><span>' + label + '</span></li>':
					selectlabel = label;
			} );
			this.listopts = $('<ul/>').append(optshtml);
			this.selectlabel = $('<span/>').append(selectlabel);
			this.dd = $('<div class="action"/>').append(this.selectlabel,this.listopts).insertAfter(this.$el);
			this.$el.remove();
		},
		_positionOpts: function(anim) {
			var self = this;
      $('.main').css('height', (this.optsCount+1)*(this.size.height+this.options.gutter)+40);
      this.dd.css('height', 'auto');
			this.listopts.css('height', 'auto');
			this.opts.each(function(i) {
					$(this).css({
						zIndex: self.minZIndex+self.optsCount-1-i,
						top: self.options.slidingIn?(i+1)*(self.size.height+self.options.gutter):0,
						left: 0,
						marginLeft: self.options.slidingIn?i%2===0?self.options.slidingIn:-self.options.slidingIn:0,
						opacity: self.options.slidingIn ? 0 : 1,
						transform: 'none'
					});
				});
			if( !this.options.slidingIn ){
				this.opts.eq( this.optsCount - 1).css({ 
          top: this.options.stack ? 9 : 0,
          left: this.options.stack ? 4 : 0,
          width: this.options.stack ? this.size.width - 8 : this.size.width,
          transform: 'none' 
        }).end().eq(this.optsCount - 2).css({
          top: this.options.stack ? 6 : 0,
          left: this.options.stack ? 2 : 0,
          width: this.options.stack ? this.size.width - 4 : this.size.width,
          transform: 'none'
        }).end().eq(this.optsCount - 3).css({
          top: this.options.stack ? 3 : 0,
          left: 0,
          transform : 'none'
        });
			}
		},
		_initEvents : function() {			
			var self = this,
				throwHook = this._throwHook;			
			this.selectlabel.on( 'mousedown.dropdown', function( event ) {
				self.opened ? self.close() : self.open();
				return false;
			} );

			this.opts.on( 'click.dropdown', function() {
				if( self.opened ) {
					var opt = $( this );
					self.options.onOptionSelect( opt );
					self.inputEl.val( opt.data( 'value' ) );
					self.selectlabel.html( opt.html() );
					self.close();
				}
			} );
		},
		open : function() {
			var self = this;
      $('.main').css('height', (this.optsCount+1)*(this.size.height+this.options.gutter)+40);
			this.dd.toggleClass('active').css('height', (this.optsCount+1)*(this.size.height+this.options.gutter));
			this.listopts.css('height', (this.optsCount+1)*(this.size.height+this.options.gutter));
			this.opts.each(function(i) {
				$( this ).css( {
					opacity : 1,
					top: self.options.rotated?self.size.height+self.options.gutter:(i+1)*(self.size.height+self.options.gutter),
					left : self.options.random ? Math.floor( Math.random() * 11 - 5 ) : 0,
					width : self.size.width,
					marginLeft : 0,
					transform : self.options.random ?
						'rotate(' + Math.floor( Math.random() * 11 - 5 ) + 'deg)' :
						self.options.rotated ?
							self.options.rotated === 'right' ?
								'rotate(-' + ( i * 5 ) + 'deg)' :
								'rotate(' + ( i * 5 ) + 'deg)'
							: 'none',
					transitionDelay: self.options.delay&&Modernizr.csstransitions?self.options.slidingIn?(i*self.options.delay)+'ms':((self.optsCount-1-i)*self.options.delay)+'ms':0
				});
			});
			this.opened = true;
		},
		close : function() {
			var self = this;
			this.dd.toggleClass( 'active' );
			if( this.options.delay && Modernizr.csstransitions ) {
				this.opts.each( function( i ) {
					$( this ).css( { 'transition-delay' : self.options.slidingIn ? ( ( self.optsCount - 1 - i ) * self.options.delay ) + 'ms' : ( i * self.options.delay ) + 'ms' } );
				} );
			}
			this._positionOpts( true );
			this.opened = false;
		}
	}
	$.fn.dropdown = function( options ) {
		var instance = $.data( this, 'dropdown' );
		if ( typeof options === 'string' ) {
			var args = Array.prototype.slice.call( arguments, 1 );
			this.each(function() {
				instance[ options ].apply( instance, args );
			});
		}
		else {
			this.each(function() {
				instance ? instance._init() : instance = $.data( this, 'dropdown', new $.DropDown( options, this ) );
			});
		}
		return instance;
	};
})(jQuery,window );			
$(function() {$('#selection').dropdown({gutter: 5});});

		
              
            
!
999px

Console