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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

            
              <html>
<head>
    <style>
        .item {width:300px; display: inline-block; }
        .item .itemtitle {font-weight:bold; font-size:2em;}
        .hidden {display:none;}
    </style>
</head>
<body>
    <h1>Amalgam Comics Characters</h1>
<div id="listing">

    <div class="item">
        <img 
            src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" 
            class="lazy" 
            data-src="http://static9.comicvine.com/uploads/scale_medium/0/229/305993-131358-dark-claw.jpg" 
            alt="Dark Claw"
            width="300px" />
        <noscript>
            <img 
                src="http://static9.comicvine.com/uploads/scale_medium/0/229/305993-131358-dark-claw.jpg" 
                alt="Dark Claw"
                width="300px" />
        </noscript>
        <span class="itemtitle">Dark Claw</span>
    </div>
    
    <div class="item">
        <img 
            src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" 
            class="lazy" 
            data-src="http://static6.comicvine.com/uploads/scale_super/3/31666/706536-supersoldier8.jpg" 
            alt="Super Soldier"
            width="300px" />
        <noscript>
            <img 
                src="http://static6.comicvine.com/uploads/scale_super/3/31666/706536-supersoldier8.jpg" 
                alt="Super Soldier"
                width="300px" />
        </noscript>
        <span class="itemtitle">Super Soldier</span>
    </div>
    
    <div class="item">
        <img 
            src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" 
            class="lazy" 
            data-src="http://static3.comicvine.com/uploads/scale_super/3/36899/732353-spidey.jpg" 
            alt="Spider Boy"
            width="300px" />
        <noscript>
            <img 
                src="http://static3.comicvine.com/uploads/scale_super/3/36899/732353-spidey.jpg" 
                alt="Spider Boy"
                width="300px" />
        </noscript>
        <span class="itemtitle">Spider Boy</span>
    </div>
    
    <div class="item">
        <img 
            src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" 
            class="lazy" 
            data-src="http://vignette1.wikia.nocookie.net/amalgam/images/7/7c/Iron_Lantern.jpg/revision/latest?cb=20110828093145" 
            alt="Iron Lantern"
            width="300px" />
        <noscript>
            <img 
                src="http://vignette1.wikia.nocookie.net/amalgam/images/7/7c/Iron_Lantern.jpg/revision/latest?cb=20110828093145" 
                alt="Iron Lantern"
                width="300px" />
        </noscript>
        <span class="itemtitle">Iron Lantern</span>
    </div>
    
    <div class="item">
        <img 
            src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" 
            class="lazy" 
            data-src="http://static6.comicvine.com/uploads/scale_super/0/1867/583722-amalgam_amazon1.jpg" 
            alt="Amazon"
            width="300px" />
        <noscript>
            <img 
                src="http://static6.comicvine.com/uploads/scale_super/0/1867/583722-amalgam_amazon1.jpg" 
                alt="Amazon"
                width="300px" />
        </noscript>
        <span class="itemtitle">Amazon</span>
    </div>
    
    <div class="item">
        <img 
            src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" 
            class="lazy" 
            data-src="http://static4.comicvine.com/uploads/scale_super/0/1867/583727-bizarnage1.jpg" 
            alt="Bizarnage"
            width="300px" />
        <noscript>
            <img 
                src="http://static4.comicvine.com/uploads/scale_super/0/1867/583727-bizarnage1.jpg" 
                alt="Bizarnage"
                width="300px" />
        </noscript>
        <span class="itemtitle">Bizarnage</span>
    </div>
    
    <div class="item">
        <img 
            src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" 
            class="lazy" 
            data-src="http://static1.comicvine.com/uploads/scale_super/0/1867/583724-amcatsai1.jpg" 
            alt="Catsai"
            width="300px" />
        <noscript>
            <img 
                src="http://static1.comicvine.com/uploads/scale_super/0/1867/583724-amcatsai1.jpg" 
                alt="Catsai"
                width="300px" />
        </noscript>
        <span class="itemtitle">Catsai</span>
    </div>
    
    <div class="item">
        <img 
            src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" 
            class="lazy" 
            data-src="http://static4.comicvine.com/uploads/scale_super/0/1867/583743-moonwing1.jpg" 
            alt="Moonwing"
            width="300px" />
        <noscript>
            <img 
                src="http://static4.comicvine.com/uploads/scale_super/0/1867/583743-moonwing1.jpg" 
                alt="Moonwing"
                width="300px" />
        </noscript>
        <span class="itemtitle">Moonwing</span>
    </div>
    
    <div class="item">
        <img 
            src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" 
            class="lazy" 
            data-src="http://static5.comicvine.com/uploads/scale_super/0/1867/583739-hawkeyei.jpg" 
            alt="Hawkeye"
            width="300px" />
        <noscript>
            <img 
                src="http://static5.comicvine.com/uploads/scale_super/0/1867/583739-hawkeyei.jpg" 
                alt="Hawkeye"
                width="300px" />
        </noscript>
        <span class="itemtitle">Hawkeye</span>
    </div>
    
    <div class="item">
        <img 
            src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" 
            class="lazy" 
            data-src="http://static3.comicvine.com/uploads/scale_super/0/1867/583733-ammrcury1.jpg" 
            alt="Mercury"
            width="300px" />
        <noscript>
            <img 
                src="http://static3.comicvine.com/uploads/scale_super/0/1867/583733-ammrcury1.jpg" 
                alt="Mercury"
                width="300px" />
        </noscript>
        <span class="itemtitle">Mercury</span>
    </div>
    
    <div class="item">
        <img 
            src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" 
            class="lazy" 
            data-src="http://static2.comicvine.com/uploads/scale_super/0/1867/583737-drfate3.jpg" 
            alt="Dr. Strangefate"
            width="300px" />
        <noscript>
            <img 
                src="http://static2.comicvine.com/uploads/scale_super/0/1867/583737-drfate3.jpg" 
                alt="Dr. Strangefate"
                width="300px" />
        </noscript>
        <span class="itemtitle">Dr. Strangefate</span>
    </div>

 </div>

<script>
registerListener('load', lazyLoad);
registerListener('scroll', lazyLoad);

function lazyLoad(){
	    var lazy = 
	    document.getElementsByClassName('lazy');
	
	    for(var i=0; i<lazy.length; i++) {
	        if(isInViewport(lazy[i])){
               lazy[i].src =
                lazy[i].getAttribute('data-src');
            }
	    }
	 }

function isInViewport(el){
    var rect = el.getBoundingClientRect();
    
    return (
        rect.bottom >= 0 && 
        rect.right >= 0 && 
        rect.top <= (window.innerHeight || document.documentElement.clientHeight) && 
        rect.left <= (window.innerWidth || document.documentElement.clientWidth)
     );
}

function registerListener(event, func) {
    if (window.addEventListener) {
        window.addEventListener(event, func)
    } else {
        window.attachEvent('on' + event, func)
    }
}
</script>
</body>
</html>
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console