"cool toggle button"
Bootstrap 3.0.0 Snippet by evarevirus

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!DOCTYPE html><html class=''> <head><script src='//production-assets.codepen.io/assets/editor/live/console_runner-079c09a0e3b9ff743e39ee2d5637b9216b3545af0de366d4b9aad9dc87e26bfd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/events_runner-73716630c22bbc8cff4bd0f07b135f00a0bdc5d14629260c3ec49e5606f98fdd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/css_live_reload_init-2c0dc5167d60a5af3ee189d570b1835129687ea2a61bee3513dee3a50c115a77.js'></script><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/rss/pen/vIDKH?limit=all&page=89&q=box" /> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css'><script src='https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js'></script> <style class="cp-pen-styles">body{ background:#222; padding: 100px; font-size: 10px; /*increase me to scale toogle-icon*/ } #nav-container{ position: absolute; top: 50%; left: 50%; margin:-3em; } /*toggle-icon*/ .toggle-icon { display: block; position: relative; width: 100%; margin: -2.2em auto 0 0.2em; -webkit-transition: margin 600ms; -moz-transition: margin 600ms; transition: margin 600ms; cursor: pointer; } .toggle-icon .bar { display: block; width: 3.8em; height: 0.2em; margin: 0.9em; border-right: 2.8em solid #fff; border-left: 0.6em solid #d6d6d6; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-transition-property: -webkit-transform, margin, border-right-color, box-shadow; -moz-transition-property: -moz-transform, margin, border-right-color, box-shadow; transition-property: transform, margin, border-right-color, box-shadow; -webkit-transition-duration: 600ms; -moz-transition-duration: 600ms; transition-duration: 600ms; } .toggle-icon .bar:nth-of-type(1) { -webkit-transition: opacity 300ms; -moz-transition: opacity 300ms; transition: opacity 300ms; } .toggle-icon .bar:nth-of-type(2) { -webkit-transform: rotate(-180deg); -moz-transform: rotate(-180deg); -ms-transform: rotate(-180deg); -o-transform: rotate(-180deg); transform: rotate(-180deg); } /*pushed*/ .pushed .toggle-icon { margin: -3.2em 0 0 0.7em; } .pushed .bar:nth-of-type(1) { opacity: 0; } .pushed .bar:nth-of-type(2) { margin-left: 1.4em; -webkit-transform: rotate(-137deg) translateY(-1.5em); -moz-transform: rotate(-137deg) translateY(-1.5em); -ms-transform: rotate(-137deg) translateY(-1.5em); -o-transform: rotate(-137deg) translateY(-1.5em); transform: rotate(-137deg) translateY(-1.5em); } .pushed .bar:nth-of-type(3) { margin-left: 0.5em; -webkit-transform: rotate(-42deg); -moz-transform: rotate(-42deg); -ms-transform: rotate(-42deg); -o-transform: rotate(-42deg); transform: rotate(-42deg); } .pushed .toggle-icon:hover .bar:nth-of-type(2) { border-right-color: #e9b8b9; box-shadow: 0.4em 0 0.6em 0.1em rgba(205,40,44,0.75); } .pushed .toggle-icon:hover .bar:nth-of-type(3) { border-right-color: #ddf1da; box-shadow: 0.4em 0 0.6em 0.1em rgba(83,228,68,0.65); }</style></head><body> <div id="nav-container"> <div class="toggle-icon"> <span class="bar"></span> <span class="bar"></span> <span class="bar"></span> </div><!-- /toggle-icon --> </div><!-- /nav-container --> <script src='//production-assets.codepen.io/assets/common/stopExecutionOnTimeout-b2a7b3fe212eaa732349046d8416e00a9dec26eb7fd347590fbced3ab38af52e.js'></script><script src='//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script >$(".toggle-icon").click(function() { $('#nav-container').toggleClass("pushed"); }); /*** starwars.com's Toggle Icon Animation ***/ //# sourceURL=pen.js </script> </body></html>

Related: See More


Questions / Comments: