<div class="mobile-menu-icon">
  <span></span>
  <span></span>
  <span></span>
  <span></span>
</div>
/* ============================================================================================== 
Renata G Martins
http://www.renatagmartins.com.br
================================================================================================= */
body{
  background:#009966
}
* {
  margin: 0;
  padding: 0; 
}

.mobile-menu-icon{
  width: 60px;
  height: 45px;
  position: relative;
  margin: 50px auto;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: .5s ease-in-out;
  -moz-transition: .5s ease-in-out;
  -o-transition: .5s ease-in-out;
  transition: .5s ease-in-out;
  cursor: pointer;
}

.mobile-menu-icon span{
  display: block;
  position: absolute;
  height: 9px;
  width: 100%;
  background: #ffffff;
  border-radius: 8px;
  opacity: 1;
  left: 0;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: .25s ease-in-out;
  -moz-transition: .25s ease-in-out;
  -o-transition: .25s ease-in-out;
  transition: .25s ease-in-out;
}

.mobile-menu-icon span:nth-child(1) {
  top: 0px;
}

.mobile-menu-icon span:nth-child(2),.mobile-menu-icon span:nth-child(3) {
  top: 18px;
}

.mobile-menu-icon span:nth-child(4) {
  top: 36px;
}

.mobile-menu-icon.open span:nth-child(1) {
  top: 18px;
  width: 0%;
  left: 50%;
}

.mobile-menu-icon.open span:nth-child(2) {
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
}

.mobile-menu-icon.open span:nth-child(3) {
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
}

.mobile-menu-icon.open span:nth-child(4) {
  top: 18px;
  width: 0%;
  left: 50%;
}
$(document).ready(function(){
	$('.mobile-menu-icon').click(function(){
		$(this).toggleClass('open');
	});
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. //cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js