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.

Quick-add: + add another resource

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.

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.

            
              <body>
    <div class="lk-wrapper">
        <div class="lk-content">
            
            <nav class="lk-nav"> <!-- off viewport navigation -->
                <p class="lk-close">&times;</p>
                <h2>Menu</h2>
                <ul>
                    <li>Free to scroll up and down</li>
                    <li>Add as many nav items as needed</li>
                </ul>
            </nav> <!-- end off viewport nav -->

            <a href="#" class="lk-toggle-nav"></a>
            <h1>Off Viewport Menu </h1>

        </div> <!-- lk-content -->
    </div> <!-- lk-wrapper -->
  
  
    <script src="js/jquery-2.1.1.min.js"></script>
    <script src="js/script.js"></script>
</body>
            
          
!
            
              *,
:before,
:after{
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/********************
#CLASSES
********************/
.is-mobile{

}

.is-tablet{
    display: none;
}

.is-desktop{
    display: none;
}

.lk-squeeze{
    position: relative;
    max-width: 1000px;
    width: 100%;
    padding: 0 10px;
    margin: 0 auto;
}

.lk-clear{
    display: block;
    float: none;
    clear: both;
}

.lk-clear-self:after{
    content: "."; 
    visibility: hidden; 
    display: block; 
    height: 0; 
    clear: both;
}

.float-left{
    float: left;
}

.float-right{
    float: right;
}
/********************
END CLASSES
********************/

/********************
#STRUCTURE
********************/
html{
    height: 100%;
}

body{
    font-size: 100%;
    height: 100%;
}

ul {
    list-style: none;
}

.lk-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;

}

/**
*
* .lk-content wraps the content of the entire site. 
* Our menu is absolutely positioned inside of it,
* so when we move this wrapper, the menu shows
*
*/
.lk-content {
    height: 100%;
    padding: 10px;
    position: relative;
    width: 100%;

    -webkit-transform: translateX(0);
    transform: translateX(0);
    -webkit-transition: .3s ease all;
    transition: .3s ease all;
}

    .lk-toggle-nav {
        cursor: pointer;
        padding-left: 10px;
    }

    .lk-toggle-nav:before {
        content: '';
        position: absolute;
        top: 12px;
        left: 10px;
        width: 20px;
        height: 13px;
        border-top: 8px double #000;
        border-bottom: 3px solid #000;
    }

/**
*
* Our off viewport nav, free to scoll along
* its y-axis.
*/
.lk-nav {
    background: #428bca;
    height: 100%;
    left: -300px;
    overflow-y: scroll;
    position: absolute;
    padding: 15px;
    top: 0;
    width: 300px;
}

    .lk-close {
        cursor: pointer;
        float: right;
    }

/**
*
* To change switch animation to opposite side:
*   1. Change .lk-nav's left to right
*   2. Change transformation to a negative X value (i.e. -300px)
*
*/
.lk-wrapper.show-nav .lk-content{
    -webkit-transform: translateX(300px);
    transform: translateX(300px);
}

footer{
}

/********************
END STRUCTURE
********************/

/********************
#MEDIA QUERIES
********************/
@media screen and (min-width: 0){

}

/********************
END MEDIA QUERIES
********************/
            
          
!
            
              /*********************************************
*                ON DOM READY                *
*********************************************/
$(function() {
    $('.lk-toggle-nav').click(function() {
        toggleNav();
    });
    $('.lk-close').click(function() {
        toggleNav();
    });
});




/*********************************************
*                  FUNCTIONS                 *
*********************************************/
function toggleNav() {
    if($('.lk-wrapper').hasClass('show-nav')) {
        $('.lk-wrapper').removeClass('show-nav');
    }
    else {
        $('.lk-wrapper').addClass('show-nav');
    }
}


            
          
!
999px
Loading ..................

Console