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.

            
              <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
Loading ..................

Console