Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


                <div class="menu">
    <li><a href="Home">home</a></li>
    <li><p class="subMenuLinkOne">item 1</p>
      <ul class="subMenu subMenuOne">
        <h2>Sub Menu One</h2>
        <li><a href="sub item 1">sub item 1</a></li>
        <li><a href="sub item 2">sub item 2</a></li>
        <p class="closeOne">Close</p>
        <li><p class="subMenuLinkTwo">item 2</p>
      <ul class="subMenu subMenuTwo">
        <h2>Sub Menu Two</h2>
        <li><a href="sub item 1">sub item 1</a></li>
        <li><a href="sub item 2">sub item 2</a></li>
        <p class="closeTwo">Close</p>
        <li><p class="subMenuLinkThree">item 3</p>
      <ul class="subMenu subMenuThree">
        <h2>Sub Menu Three</h2>
        <li><a href="sub item 1">sub item 1</a></li>
        <li><a href="sub item 2">sub item 2</a></li>
        <p class="closeThree">Close</p>


                * {
  box-sizing: border-box;

body {
  overflow: hidden;
.menu {
  padding: 3em;
  position: absolute;
  background: green;
  width: 30%;
  .subMenu {
    display: block;
    position: absolute;
    padding: 3em;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: #000;
    z-index: -99;
    color: white;
    width: 100%;
    margin-left: -100%;
  .subMenuOne {
    background: red;
  .subMenuTwo {
    background: pink;
  .subMenuThree {
    background: purple;

li {
  padding: 1em;


                const tlOne = gsap.timeline();
const tlTwo = gsap.timeline();
const tlThree = gsap.timeline();
      const menuOne = document.querySelector('.subMenuLinkOne');
      const menuTwo = document.querySelector('.subMenuLinkTwo');
      const menuThree = document.querySelector('.subMenuLinkThree');
      const exitOne = document.querySelector('.closeOne');
      const exitTwo = document.querySelector('.closeTwo');
      const exitThree = document.querySelector('.closeThree');

//         let currentSection; // when a section is open, store it here.

//         function openMenuSection(section) {
//           let tl = gsap.timeline();
//           if (currentSection) {
//   '.subMenu', {marginLeft: -"100%"});
//           }
// , { menu animation...});
//           currentSection = section; // record the current section
//           return tl;
//         }
  	  	// Sub menu one
        tlOne.fromTo('.subMenuOne', {marginLeft: "-100%"}, {marginLeft: "100%"});
        menuOne.addEventListener('click', () => {
        exitOne.addEventListener('click', () => {
        // Sub menu two
        tlTwo.fromTo('.subMenuTwo', {marginLeft: "-100%"}, {marginLeft: "100%"});
        menuTwo.addEventListener('click', () => {
        exitTwo.addEventListener('click', () => {
        // Sub menu three
        tlThree.fromTo('.subMenuThree', {marginLeft: "-100%"}, {marginLeft: "100%"});
        menuThree.addEventListener('click', () => {
        exitThree.addEventListener('click', () => {