"btn"
Bootstrap 2.3.2 Snippet by SANTANU CHOWDHURY

<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="line-top"></div> <div class="line-middle"></div> <div class="line-bottom"></div> </div>
.container { position: relative; height: 28px; width: 36px; cursor: pointer; } .container .line-top, .container .line-middle, .container .line-bottom { position: absolute; display: block; height: 2px; width: 36px; border-radius: 2px; background: #000; } .container .line-top { top: 0; transform-origin: 34px 2px; } .container .line-middle { top: 12px; transition: opacity 200ms linear; } .container .line-bottom { bottom: 2px; transform-origin: 34px 2px; } .container.is-open .line-top { animation: line-top-out 600ms linear normal; animation-fill-mode: forwards; } .container.is-open .line-middle { opacity: 0; } .container.is-open .line-bottom { animation: line-bot-out 600ms linear normal; animation-fill-mode: forwards; } .container.is-closed .line-top { animation: line-top-in 600ms linear normal; animation-fill-mode: forwards; } .container.is-closed .line-middle { transition-delay: 200ms; } .container.is-closed .line-bottom { animation: line-bot-in 600ms linear normal; animation-fill-mode: forwards; } @keyframes line-top-in { 0% { left: -5px; bot: 0; transform: rotate(-45deg); } 20% { left: -5px; bot: 0; transform: rotate(-60deg); } 80% { left: 0; bot: 0; transform: rotate(15deg); } 100% { left: 0; bot: 1px; transform: rotate(0deg); } } @keyframes line-top-out { 0% { left: 0; top: 0; transform: rotate(0deg); } 20% { left: 0; top: 0; transform: rotate(15deg); } 80% { left: -5px; top: 0; transform: rotate(-60deg); } 100% { left: -5px; top: 1px; transform: rotate(-45deg); } } @keyframes line-bot-in { 0% { left: -5px; transform: rotate(45deg); } 20% { left: -5px; bot: 0; transform: rotate(60deg); } 80% { left: 0; bot: 0; transform: rotate(-15deg); } 100% { left: 0; transform: rotate(0deg); } } @keyframes line-bot-out { 0% { left: 0; transform: rotate(0deg); } 20% { left: 0; transform: rotate(-15deg); } 80% { left: -5px; transform: rotate(60deg); } 100% { left: -5px; transform: rotate(45deg); } } .stage { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); }
$(function() { $(".container").on("click", function() { var that = $(this); if (that.hasClass("is-open")) { that.removeClass("is-open").addClass("is-closed"); } else { that.removeClass("is-closed").addClass("is-open"); } }); });

Related: See More


Questions / Comments: