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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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 id="oc-container" class="oc-container">
  <div class="oc-pusher">

    <div id="oc-trigger">
      <button id="menu-button" data-effect="oc-push">Menu</button>
    </div>

    <header role="banner">
      <h1 class="company-name">A11Y Off Canvas Push Menu</h1>

      <nav id="menu" class="oc-menu oc-push" role="navigation">
        <ul>
          <li><a href="#">About</a></li>
          <li><a href="#">Shop</a></li>
          <li><a href="#">Gallery</a></li>
          <li><a href="#">FAQs</a></li>
          <li><a href="#">Support</a></li>
          <li><a href="#">login</a></li>
          <li><a href="#">Partners</a></li>
          <li><a href="#">Members</a></li>
          <li><a href="#">Site Map</a></li>
          <li><a href="#">News</a></li>
          <li><a href="#">RSS Feed</a></li>
          <li><a href="#">Facebook</a></li>
          <li><a href="#">Twitter</a></li>
          <li><a href="#">Flickr</a></li>
          <li><a href="#">Skype</a></li>
        </ul>
      </nav>
    </header>

    <main class="oc-content" role="main">
      <div class="oc-content-inner">
        <div class="main">

          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>

        </div>
      </div>
    </main>

  </div>
</div>
            
          
!
            
              .oc-container,
.oc-pusher,
.oc-content {
  height: 100%;
}

.oc-content {
  overflow-y: scroll;
}

.oc-content,
.oc-content-inner {
  position: relative;
}

.oc-container {
  position: relative;
  overflow: hidden;
  overflow-y: scroll;
}

.oc-pusher {
  height: auto;
  position: relative;
  left: 0;
  -webkit-transition: -webkit-transform 400ms;
  transition: transform 400ms;
  z-index: 99;
}
.oc-pusher::after {
  content: '';
  height: 0;
  position: absolute;
  top: 0;
  right: 0;
  opacity: 0;
  width: 0;
  -webkit-transition: opacity 400ms, width 0.1s 400ms, height 0.1s 400ms;
  transition: opacity 400ms, width 0.1s 400ms, height 0.1s 400ms;
  background: transparent;
}
.oc-menu-open .oc-pusher::after {
  height: 100%;
  opacity: 1;
  -webkit-transition: opacity 400ms;
  transition: opacity 400ms;
  width: 100%;
}

.oc-menu {
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  -webkit-transition: all 400ms;
  transition: all 400ms;
  visibility: hidden;
  width: 225px;
  z-index: 100;
  background: #999999;
}
.oc-menu-open .oc-menu::after {
  height: 0;
  opacity: 0;
  -webkit-transition: opacity 400ms, width 0.1s 400ms, height 0.1s 400ms;
  transition: opacity 400ms, width 0.1s 400ms, height 0.1s 400ms;
  width: 0;
}

.oc-push.oc-menu {
  -webkit-transform: translate3d(-100%, 0, 0);
  transform: translate3d(-100%, 0, 0);
}
.oc-push.oc-menu::after {
  display: none;
}
.oc-push.oc-menu-open .oc-pusher {
  -webkit-transform: translate3d(225px, 0, 0);
  transform: translate3d(225px, 0, 0);
}

.oc-push.oc-menu-open .oc-push.oc-menu {
  overflow: scroll;
  -webkit-transition: -webkit-transform 400ms;
  transition: transform 400ms;
  visibility: visible;
}

.no-js .oc-menu {
  height: auto;
  position: static;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  width: 100%;
  visibility: visible;
}
.no-js #oc-trigger {
  display: none;
}
.no-js .oc-pusher {
  padding-left: 0;
}

.no-csstransforms3d .oc-pusher {
  padding-left: 225px;
}

            
          
!
            
              /*!
 * classie - class helper functions
 * from bonzo https://github.com/ded/bonzo
 * 
 * classie.has( elem, 'my-class' ) -> true/false
 * classie.add( elem, 'my-new-class' )
 * classie.remove( elem, 'my-unwanted-class' )
 * classie.toggle( elem, 'my-class' )
 */
(function(e){"use strict";function t(e){return new RegExp("(^|\\s+)"+e+"(\\s+|$)")}function s(e,t){var s=n(e,t)?i:r;s(e,t)}var n,r,i;if("classList"in document.documentElement){n=function(e,t){return e.classList.contains(t)};r=function(e,t){e.classList.add(t)};i=function(e,t){e.classList.remove(t)}}else{n=function(e,n){return t(n).test(e.className)};r=function(e,t){if(!n(e,t)){e.className=e.className+" "+t}};i=function(e,n){e.className=e.className.replace(t(n)," ")}}var o={hasClass:n,addClass:r,removeClass:i,toggleClass:s,has:n,add:r,remove:i,toggle:s};if(typeof define==="function"&&define.amd){define(o)}else{e.classie=o}})(window);


/**
 * sidebarEffects.js v1.0.0
 * http://www.codrops.com
 *
 * Licensed under the MIT license.
 * https://www.opensource.org/licenses/mit-license.php
 * 
 * Copyright 2013, Codrops
 * http://www.codrops.com
 */

/*
 * ARIA Modifications made for the @A11YProject
 * by @gryghostvisuals & @svinkle
 */
var SidebarMenuEffects = (function() {

  function hasParentClass( e, classname ) {
    if(e === document) return false;

    if( classie.has( e, classname ) ) {
      return true;
    }

    return e.parentNode && hasParentClass( e.parentNode, classname );
  }

  // http://coveroverflow.com/a/11381730/989439
  function mobilecheck() {
      var check = false;
      (function(a){if(/(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);
      return check;
  }

  function init() {

    // ARIA
    var trigger = document.getElementById('menu-button'),
        menu = document.getElementById('menu');

    trigger.setAttribute('aria-expanded', 'false');
    trigger.setAttribute('aria-label', 'Menu');
    trigger.setAttribute('aria-controls', 'menu');

    menu.setAttribute('aria-hidden', 'true');
    menu.setAttribute('aria-labelledby', 'menu-button');

    var container = document.getElementById( 'oc-container' ),
        buttons = Array.prototype.slice.call( document.querySelectorAll( '#oc-trigger > button' ) ),
        // event type (if mobile use touch events)
        eventtype = mobilecheck() ? 'touchstart' : 'click',
        resetMenu = function() {
          trigger.setAttribute('aria-expanded', 'false');
          menu.setAttribute('aria-hidden', 'true');
          classie.remove( container, 'oc-menu-open' );
        },
        bodyClickFn = function(evt) {
          if( !hasParentClass( evt.target, 'oc-menu' ) ) {
            resetMenu();
            document.removeEventListener( eventtype, bodyClickFn );
          }
        };

    buttons.forEach( function( el, i ) {
      var effect = el.getAttribute( 'data-effect' );

      el.addEventListener( eventtype, function( ev ) {
        ev.stopPropagation();
        ev.preventDefault();
        el.setAttribute('aria-expanded', 'true');
        menu.setAttribute('aria-hidden', 'false');
        container.className = 'oc-container'; // clear
        classie.add( container, effect );
        setTimeout( function() {
            classie.add( container, 'oc-menu-open' );
        }, 25 );
        document.addEventListener( eventtype, bodyClickFn );
      });

    });

    // Handle 'esc' event
    // Keyboard Tweaks via Scott Vinkle
    var escapeMenu = function (ev) {
      if (ev.which === 27) {
          ev.stopPropagation();
          ev.preventDefault();
          resetMenu();
          trigger.focus();
        }
    };

    trigger.addEventListener( 'keydown', function( ev ) {
        escapeMenu(ev);
    });

    menu.addEventListener( 'keydown', function( ev ) {
        escapeMenu(ev);
    });
  }

  init();

})();
            
          
!
999px
Loading ..................

Console