cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-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.

            
              

<header>
  <div class="container-fluid">
    <div class="row">
      <div class="col-md-12">
        <a href="/" class="logo">Scotch Panels</a>
        <a href="#" class="toggle-panel"><i class="fa fa-bars"></i></a>
      </div>
    </div>
  </div>
</header>


<div id="site-wrapper">
  <div id="scotch-panel"><!-- Left blank on purpose --></div>

    

    <article>
       <div class="container">
       
                <h1>Makes fixed navbar non-fixed - EXAMPLE 3</h1>
      <p class="lead"><a href="https://github.com/scotch-io/scotch-panels/issues/7">https://github.com/scotch-io/scotch-panels/issues/7</a></p>
              
         <p>This is it, this is it. This is life, the one you get, so go and have a ball. This is it, this is it. Straight ahead, and rest assured you can't be sure at all. So while you're here enjoy the view, keep on doing what you do, so hold on tight we'll muddle through one day at a time, one day at a time. So up on your feet, up on your feet - somewhere there's music playing. Don't you worry none, we'll just take it like it comes, one day at a time, one day at a time.</p>

<p>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>My name is Rhoda Morgenstern. I was born in the Bronx, New York in December of 1941. I've always felt responsible for World War II. The first thing I remember liking that liked me back was food. I had a bad puberty; it lasted seventeen years. I'm a high school graduate. I went to art school. My entrance exam was on a book of matches. I decided to move out of the house when I was twenty-four. My mother still refers to this as the time I ran away from home. Eventually, I ran to Minneapolis, where it's cold and I figured I'd keep better. Now I'm back in Manhattan. New York, this is your last chance!</p>


         <p>This is it, this is it. This is life, the one you get, so go and have a ball. This is it, this is it. Straight ahead, and rest assured you can't be sure at all. So while you're here enjoy the view, keep on doing what you do, so hold on tight we'll muddle through one day at a time, one day at a time. So up on your feet, up on your feet - somewhere there's music playing. Don't you worry none, we'll just take it like it comes, one day at a time, one day at a time.</p>

<p>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>My name is Rhoda Morgenstern. I was born in the Bronx, New York in December of 1941. I've always felt responsible for World War II. The first thing I remember liking that liked me back was food. I had a bad puberty; it lasted seventeen years. I'm a high school graduate. I went to art school. My entrance exam was on a book of matches. I decided to move out of the house when I was twenty-four. My mother still refers to this as the time I ran away from home. Eventually, I ran to Minneapolis, where it's cold and I figured I'd keep better. Now I'm back in Manhattan. New York, this is your last chance!</p>


      </div>
    </article>
  
</div>

<div id="fixed-nav">
  <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Services</a></li>
    <li><a href="#">Contact</a></li>
  </ul>
</div>
            
          
!
            
              /*==================================
=            SITE STUFF            =
==================================*/
a {
    text-decoration: none !important;
    -webkit-transition: all 225ms ease;
    -moz-transition: all 225ms ease;
    transition: all 225ms ease;
}
header {
  
    -webkit-transition: all 300ms ease;
    -moz-transition: all 300ms ease;
    transition: all 300ms ease;
  
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999999;
    background: #222;
    height: 50px;
}
header a {
    color: #777;
}
header a:hover {
    color: #fff;
}
header .logo {
    display: inline-block;
    height: 50px;
    line-height: 50px;
}
header .toggle-panel {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 25px;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    background: #333;
}
article {
    height: 1000px;
}




/*====================================
=            PANEL STYLES            =
====================================*/
#scotch-panel {
  display: none;
}
#site-wrapper {
  padding-top: 50px;
}
#site-wrapper .scotch-panel-canvas {
  z-index: 99999;
}
#fixed-nav {
    background: #444;
    position: fixed;
    height: 100%; 
    top: 0;
    right: 0;
    width: 70%;
    /* padding-top: 50px; */
}
#fixed-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}
#fixed-nav ul li a {
    display: block;
    width: 100%;
    height: 50px;
    line-height: 50px;
    background: transparent;
    color: #fff;
}
#fixed-nav ul li a:hover {
    background: #555;
}
article {
  background: #fff;
}

            
          
!
            
              /*
* https://panels.scotch.io
* https://github.com/scotch-io/scotch-panels/issues/7
*/

$(function() {

    $('#scotch-panel').scotchPanel({
        containerSelector: '#site-wrapper',
        direction: 'right',
        duration: 300,
        transition: 'ease',
        clickSelector: '.toggle-panel',
        distanceX: '70%',
        enableEscapeKey: true,
        
      beforePanelOpen: function() {
          $('header').css({
            '-moz-transform': 'translate3d(-70%, 0, 0)',
            '-ms-transform': 'translate3d(-70%, 0, 0)',
            '-o-transform': 'translate3d(-70%, 0, 0)',
            '-webkit-transform': 'translate3d(-70%, 0, 0)',
            'transform': 'translate3d(-70%, 0, 0)'
          });
        },
        beforePanelClose: function() {
          $('header').css({
            '-moz-transform': 'translate3d(0, 0, 0)',
            '-ms-transform': 'translate3d(0, 0, 0)',
            '-o-transform': 'translate3d(0, 0, 0)',
            '-webkit-transform': 'translate3d(0, 0, 0)',
            'transform': 'translate3d(0, 0, 0)'
          });
        }
    });

});
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console