Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

              
                <ul id="posts">
			<li>
				<article>	
				<h1>ā–½ SCROLL ā–½</h1>
	<p>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br><br>
		šŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒšŸ˜ƒ<br>


	</p>		
				</article>
			</li>
		</ul>
              
            
!

CSS

              
                body {
	margin: 0;
	font-family: helvetica;
	background-color: #FFE0B2;
}

::-webkit-scrollbar { 
    display: none; 
}

#posts {
	width: 250px;
	list-style-type: none;
	position: absolute;
	left: 0;
	right: 0;
	margin: auto;
	top:40px;
}

article p {
	line-height: 1;
	font-size: 2em;
}



              
            
!

JS

              
                $(document).ready(function() {
	var win = $(window);

	// Each time the user scrolls
	win.scroll(function() {
		// End of the document reached?
		if ($(document).height() - win.height() == win.scrollTop()) {
			//$('#loading').show();

			// Uncomment this AJAX call to test it
			/*
			$.ajax({
				url: 'get-post.php',
				dataType: 'html',
				success: function(html) {
					$('#posts').append(html);
					$('#loading').hide();
				}
			});
			*/

			$('#posts').append(randomPost());
			//$('#loading').hide();
		}
	});
});

// Generate a random post
function randomPost() {
	// Paragraphs that will appear in the post
	var paragraphs = [
		'<p>šŸ˜†šŸ˜†šŸ˜†šŸ˜†šŸ˜†šŸ˜†<br /></p>'
	];

	// Shuffle the paragraphs
	for (var i = paragraphs.length - 1; !!i; --i) {
		var j = Math.floor(Math.random() * i);
		var p = paragraphs[i];
		paragraphs[i] = paragraphs[j];
		paragraphs[j] = p;
	}

	// Generate the post
	var post = '<li>';
	post += '<article>';
	//post += '<header><h1>Random Article!</h1></header>';
	post += paragraphs.join('');
	post += '</article>';
	post += '</li>';

	return post;
}

              
            
!
999px

Console