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

Auto Save

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

              
                <h1>Test of Lazy Loading PDF</h1>

<p>
 intrigued by the shower bag stretch lick butt flop over give attitude hunt anything that moves chase imaginary bugs  behind the couch, all of a sudden go crazy  intently sniff hand   stand in front of the computer screen  flop over destroy couch swat at dog attack feet hide when guests come over, why must they do that chew ipad power cord  hopped up on goofballs chase mice  claw drapes destroy couch hopped up on goofballs. Hopped up on goofballs give attitude destroy couch hunt anything that moves all of a sudden go crazy  intently sniff hand  behind the couch why must they do that  claw drapes  intrigued by the shower attack feet  lick butt bag stretch, flop over chew ipad power cord  chase imaginary bugs swat at dog chase mice flop over  stand in front of the computer screen  hide when guests come over  intently sniff hand  why must they do that  intrigued by the shower  stand in front of the computer screen . Hide when guests come over  stand in front of the computer screen  flop over behind the couch chase imaginary bugs hopped up on goofballs destroy couch all of a sudden go crazy, attack feet hunt anything that moves chase mice  intrigued by the shower chew ipad power cord   claw drapes flop over,  swat at dog lick butt  intently sniff hand  why must they do that give attitude. Chase imaginary bugs  claw drapes behind the couch hide when guests come over swat at dog give attitude  intently sniff hand  hopped up on goofballs why must they do that chew ipad power cord , bag stretch attack feet all of a sudden go crazy flop over lick butt destroy couch hunt anything that moves . Why must they do that lick butt flop over hopped up on goofballs chase imaginary bugs chase mice behind the couch all of a sudden go crazy  intently sniff hand  hunt anything that moves, flop over bag stretch   claw drapes  stand in front of the computer screen   intrigued by the shower chew ipad power cord  attack feet, give attitude swat at dog hide when guests come over destroy couch hide when guests come over chase mice chew ipad power cord  attack feet. Swat at dog attack feet why must they do that flop over all of a sudden go crazy hide when guests come over bag stretch lick butt flop over behind the couch  intently sniff hand  ,  stand in front of the computer screen  chase mice hunt anything that moves chase imaginary bugs  claw drapes destroy couch chew ipad power cord   intrigued by the shower give attitude hopped up on goofballs, bag stretch  intrigued by the shower flop over  claw drapes hide when guests come over  intently sniff hand  lick butt swat at dog all of a sudden go crazy chew ipad power cord .
</p>
<p>
 swat at dog behind the couch chase mice hopped up on goofballs all of a sudden go crazy bag stretch  stand in front of the computer screen  flop over, flop over  intrigued by the shower  claw drapes give attitude chase imaginary bugs why must they do that destroy couch attack feet, hide when guests come over  intently sniff hand  hunt anything that moves chew ipad power cord  lick butt why must they do that behind the couch. Why must they do that  intently sniff hand  destroy couch hide when guests come over lick butt bag stretch  stand in front of the computer screen  hopped up on goofballs behind the couch  intrigued by the shower swat at dog all of a sudden go crazy give attitude attack feet, hunt anything that moves chase mice  flop over chase imaginary bugs chew ipad power cord  flop over  claw drapes destroy couch swat at dog chew ipad power cord  hopped up on goofballs.  intently sniff hand  attack feet hunt anything that moves swat at dog  behind the couch hide when guests come over flop over chase mice chase imaginary bugs destroy couch  intrigued by the shower hopped up on goofballs lick butt, bag stretch  claw drapes why must they do that  stand in front of the computer screen  chew ipad power cord  all of a sudden go crazy give attitude flop over why must they do that chase imaginary bugs destroy couch lick butt.  flop over swat at dog hopped up on goofballs give attitude flop over hunt anything that moves hide when guests come over why must they do that,  claw drapes  intently sniff hand  lick butt bag stretch chew ipad power cord  chase mice attack feet,  stand in front of the computer screen  destroy couch chase imaginary bugs  intrigued by the shower all of a sudden go crazy behind the couch swat at dog. All of a sudden go crazy give attitude  intrigued by the shower  intently sniff hand  behind the couch hopped up on goofballs attack feet lick butt chase imaginary bugs chew ipad power cord  flop over chase mice  stand in front of the computer screen  swat at dog, hide when guests come over  flop over why must they do that  claw drapes destroy couch bag stretch hunt anything that moves bag stretch  stand in front of the computer screen  lick butt. Destroy couch chase mice behind 
</p>

<div id="pdfArea">
	pdf area
</div>
              
            
!

CSS

              
                body {
	margin: 150px;
}

#pdfArea {
	width: 50vw;
	margin: auto;
}
              
            
!

JS

              
                const ADOBE_KEY = 'b9151e8d6a0b4d798e0f8d7950efea91';

if(!!window.IntersectionObserver) {
	const pdfBox = document.querySelector('#pdfArea');

	const intersectionObserver = new IntersectionObserver(function(entries, observer){
		if(entries && entries[0] && entries[0].isIntersecting){
			loadPDF();
			observer.unobserve(pdfBox);
		}
	});
	intersectionObserver.observe(pdfBox);
} else loadPDF();

function loadPDF() {
	console.log('visible');
	const adobeDCView = new AdobeDC.View({
		clientId: ADOBE_KEY, 
		divId: "pdfArea"
	});
	adobeDCView.previewFile({
      content:{ 
				location: 
        { url: "https://documentcloud.adobe.com/view-sdk-demo/PDFs/Bodea%20Brochure.pdf" }
			},
      metaData:{ fileName: "Bodea Brochure.pdf"}
    },
    {
      embedMode: "SIZED_CONTAINER"
    });
}
              
            
!
999px

Console