Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <section class="parallax-background-container">
    <div class="section-bg parallax-object" style="background-image: url('http://www.unsplash.it/1000/800');" data-breakpoint="768" data-speed="0.5"></div>
</section>
<section class="parallax-background-container">
    <div class="module-image section-bg parallax-object" style="background-image: url('http://www.unsplash.it/1300/800');" data-breakpoint="768" data-speed="0.5"></div>
</section>
<section class="parallax-background-container">
    <div class="module-image section-bg parallax-object" style="background-image: url('http://www.unsplash.it/1500/800');" data-breakpoint="768" data-speed="0.5"></div>
</section>
<section class="parallax-background-container">
    <div class="module-image section-bg parallax-object" style="background-image: url('http://www.unsplash.it/1000/600');" data-breakpoint="768" data-speed="0.5"></div>
</section>
              
            
!

CSS

              
                * { margin: 0; padding: 0; }
html, body { font: normal 400 20px/1.5 'Roboto', sans-serif; }

.parallax-background-container { 
    height: 100vh;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,0,0,0.6);
}

.section-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: -1;
}
              
            
!

JS

              
                jQuery(function($){
    
    $(window).on('load', function() {
        // PARALLAX FUNCTIN CALL
        $(".parallax-object").paralmax();
    });
  
});
/* ========================================================================= */
/* http://www.jksakura.com/paralmax */
/**
 * Paralmax is a JQuery responsive parallax plugin for multiple uses, including full size section background image, page parallax elements and more based on different use cases. With many built-in settings, users can set parallax speed, resize background image to full size or not, disable it below specific screen size, offset of the parallax element from it's center. The advantage of Paralmax is that it only adds parallax effet to elements, but not changes their style/looking, so users can easily customise/style any elements with pure HTML or CSS (position, size, image, background, content, etc).
 * @author Jake Zhong
----------------------  
-------------| |   / /
     | |     | |  / /
     | |     | | / /
     | |     | |/ /
     | |     | |\ \
     | |     | | \ \
     | |     | |  \ \
-----  |     | |   \ \
-----------------------
**/
/* ========================================================================= */	
jQuery.fn.extend({paralmax:function(){var t;return $(window).width(),t=$(window).height(),$(this).each(function(){function e(){s()?$(i).data("speed")||0===$(i).data("speed")?d.speed=$(i).data("speed"):d.speed=.5:d.speed=0}function a(){var e,a,r=i;!0===d.resizable&&($(window).width()>d.breakpoint?(e=parseInt($(r).parent().outerHeight()),a=parseInt($(r).parent().offset().top)>parseInt(t)?parseInt(t*d.speed):parseInt($(r).parent().offset().top)*d.speed,$(r).height(e+a)):$(r).height(e))}function r(){var t=i,e=$("html").scrollTop(),a=$("body").scrollTop(),r=(e>a?e:a)-d.start,n=parseInt(r*d.speed)+d.offset;$(t).css({webkitTransform:"translate3d(0, "+n+"px, 0)",MozTransform:"translate3d(0, "+n+"px, 0)",msTransform:"translateY("+n+"px)",OTransform:"translate3d(0, "+n+"px, 0)",transform:"translate3d(0, "+n+"px, 0)"})}function n(){if(!s()){var t=i;$(t).css({webkitTransform:"translate3d(0, 0, 0)",MozTransform:"translate3d(0, 0, 0)",msTransform:"translateY(0)",OTransform:"translate3d(0, 0, 0)",transform:"translate3d(0, 0, 0)"})}}function s(){return $(window).width()>d.breakpoint}var o,i=this,d={start:(o=$(i).offset()).top,stop:o.top+$(i).outerHeight(),speed:0,resizable:!!$(i).data("resize")&&$(i).data("resize"),breakpoint:$(i).data("breakpoint")?$(i).data("breakpoint"):0,offset:$(i).data("offset")?$(i).data("offset")*$(i).outerHeight():0};e(),a(),n(),s()&&r(),$(window).bind("scroll",function(){s()&&r()}),$(window).bind("resize",function(){e(),a(),n()})})}});
              
            
!
999px

Console