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 Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

            
              <article>

    <div class="overlay"></div>


    <div class="content">
        <h1>Multiple Panels on the same side</h1>
        <h2><a href="https://github.com/scotch-io/scotch-panels/issues/13">https://github.com/scotch-io/scotch-panels/issues/13</a>
        </h2>
    </div>

    <div class="toggles">
        <h3>Toggles:</h3>
        <a href="#" class="btn btn-success" id="toggle-panel-1">panel 1</a>
        <a href="#" class="btn btn-danger" id="toggle-panel-2">panel 2</a>
        <a href="#" class="btn btn-warning" id="toggle-panel-3">panel 3</a>
        <a href="#" class="btn btn-info" id="toggle-panel-4">panel 4</a>
    </div>


    <div id="panel-1" class="scotch-panel">
        <!-- ONE -->
    </div>
    <div id="panel-2" class="scotch-panel">
        <!-- TWO -->
    </div>
    <div id="panel-3" class="scotch-panel">
        <p class="lead">Overture, curtains, lights. This is it, the night of nights. No more rehearsing and nursing a part, we know every part by heart! Overture, curtains, lights. This is it, you'll hit the heights. And oh, what heights we'll hit. On with the show this is it. Tonight what heights we'll hit, on with the show this is it!</p>

        <p class="lead">My bologna has a first name, it's O-s-c-a-r. My bologna has a second name, it's M-e-y-e-r. Oh, I love to eat it every day, and if you ask me why, I'll say: 'cuz Oscar Meyer has a way with b-o-l-o-g-n-a. How's that?</p>

        <p class="lead">They're creepy and they're kooky, mysterious and spooky. They're all together ooky, the Addams Family. Their house is a museum where people come to see 'em. They really are a scream, the Addams Family. Neat. Sweet. Petite. So get a witches shawl on, a broomstick you can crawl on. We're gonna pay a call on the Addams Family.</p>


    </div>
    <div id="panel-4" class="scotch-panel">
        <!-- four -->
    </div>



</article>

            
          
!
            
              body {
  background: #e3e3e3;
}
article {
  position: relative;
  background: #fff;
  padding: 0;
  text-align: center;
  margin: 0;
}
.content {
  padding: 30px;
}
.toggles {
  margin: 20px 0;
  padding-bottom: 500px;
}
.scotch-panel {
  background: rgb(255, 78, 109);
  color: #fff;
}
#panel-3 {
  padding: padding: 30px;
}
.overlay {
  display: none;
  background: #000;
  opacity: 0.5;
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.scotch-is-showing .overlay {
  display: block;
}
            
          
!
            
              var panel1 = $('#panel-1').scotchPanel({
    containerSelector: 'article',
    direction: 'right',
    distanceX: '50%',
    clickSelector: '#toggle-panel-1',
    beforePanelOpen: function() {
      // Reset all panels
      $('.scotch-panel').css('z-index', 0);
      // Bring current panel to top
      $('#panel-1').css('z-index', 11);
    },
    type: 'image',
    imageURL: '//placekitten.com/1500/1000'
});
var panel2 = $('#panel-2').scotchPanel({
    containerSelector: 'article',
    direction: 'right',
    distanceX: '30%',
    clickSelector: '#toggle-panel-2',
    beforePanelOpen: function() {
      $('.scotch-panel').css('z-index', 0);
      $('#panel-2').css('z-index', 11);
    },
    type: 'iframe',
    iframeURL: 'https://scotch.io'
});
var panel3 = $('#panel-3').scotchPanel({
    containerSelector: 'article',
    direction: 'right',
    distanceX: '240px',
    clickSelector: '#toggle-panel-3',
    beforePanelOpen: function() {
      $('.scotch-panel').css('z-index', 0);
      $('#panel-3').css('z-index', 11);
    }
});
var panel4 = $('#panel-4').scotchPanel({
    containerSelector: 'article',
    direction: 'right',
    distanceX: '90%',
    clickSelector: '#toggle-panel-4',
    beforePanelOpen: function() {
      $('.scotch-panel').css('z-index', 0);
      $('#panel-4').css('z-index', 11);
    },
    type: 'video',
    autoPlayVideo: true,
    youtubeID: 'ePbKGoIGAXY',
    youTubeTheme: 'light'
});

$('.overlay').click(function() {
  panel1.close();
  panel2.close();
  panel3.close();
  panel4.close();
  
  return false;
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console