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="blue"></section>
<section id="acts">
<div class="container-fluid">
	<div class="row">
		<div class="col-lg-4 col-lg-offset-2 kujopad">
				<h1>The Kujo Kings</h1>
				<p>The Kujo Kings
				Known for their Ska/Punk anthems and high energy packed out shows, this 20 something band has built a strong Australian-wide following since forming in 2010.  The six-piece band are dedicated to entertaining fans with their catchy and humorous tunes, with dangerous amounts of energy, dancing, costumes and gratuitous fun being a consistent feature of their shows, the Kujo Kings are an act not to be missed!</p>
		</div>
		<div class="col-lg-4 kujoimgpos">
		</div>
	</div>
</div>
</section>
<section class="blue-long"></section>
              
            
!

CSS

              
                .blue
	width: 100%
	height: 200px
	background: blue

.blue-long
	width: 100%
	height: 1000px
	background: blue

.kujoimgpos
	background-image: url("http://www.spacex.com/files/assets/img/20090110_vertical002.jpg")
	background-repeat: no-repeat
	//background-attachment: fixed






              
            
!

JS

              
                //get heigth of the article part
var pContainerHeight = $('.kujopad').height();
console.log(pContainerHeight);
// assign same height to image part
$('.kujoimgpos').css({'height' : pContainerHeight + 'px'});

$(window).scroll(function(){

  var wScroll = $(this).scrollTop();

  if (wScroll <= pContainerHeight) {
//pull bg image of kujoimgpos wScrill*1.6 pixels up
    $('.kujoimgpos').css({
      'background-position' : '0 -'+ wScroll *1.6 +'px'
    });
  }
});
              
            
!
999px

Console