css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="container">
  <div class="leftContainer">
				<div id="lsContainer">
          <header>Dropinks</header> 
					<article>
          <h2><a href="http://www.dropinks.com/gooey-effect-in-pagination/">Gooey animation in pagination using SVG</a></h2>
        </article>

        <article>
          <h2><a href="http://www.dropinks.com/button-group-animation-in-svg/">Button group animation in SVG</a></h2>
        </article>

        <article>
          <h2><a href="http://www.dropinks.com/say-no-to-jquery-for-tooltip/">Say no to jquery for tooltip</a></h2>
        </article>

        <article>
          <h2><a href="http://www.dropinks.com/sortable-animation-using-jquery/">Sortable Animation using Jquery</a></h2>
        </article>

        <article>
          <h2><a href="http://www.dropinks.com/animated-switch-button/">Animated Switch Button</a></h2>
        </article>

        <article>
          <h2><a href="http://www.dropinks.com/scroll-timeline-using-javascript/">Scroll timeline using javascript</a></h2>
        </article>

        <article>
          <h2><a href="http://www.dropinks.com/toggle-button-css/">Toggle button with css3</a></h2>
        </article>
				</div>
			</div>
			<div class="rightContainer" id="rightContainer">
        <header>Dropinks</header> 
				<article>
          <h2><a href="http://www.dropinks.com/gooey-effect-in-pagination/">Gooey animation in pagination using SVG</a></h2>
        </article>

        <article>
          <h2><a href="http://www.dropinks.com/button-group-animation-in-svg/">Button group animation in SVG</a></h2>
        </article>

        <article>
          <h2><a href="http://www.dropinks.com/say-no-to-jquery-for-tooltip/">Say no to jquery for tooltip</a></h2>
        </article>

        <article>
          <h2><a href="http://www.dropinks.com/sortable-animation-using-jquery/">Sortable Animation using Jquery</a></h2>
        </article>

        <article>
          <h2><a href="http://www.dropinks.com/animated-switch-button/">Animated Switch Button</a></h2>
        </article>

        <article>
          <h2><a href="http://www.dropinks.com/scroll-timeline-using-javascript/">Scroll timeline using javascript</a></h2>
        </article>

        <article>
          <h2><a href="http://www.dropinks.com/toggle-button-css/">Toggle button with css3</a></h2>
        </article>
			</div>
</div>













<div class="projHeader">
  <div class="primaryText">Parallel Scrolling</div>
  <div class="secondaryText">Two or more elements</div>
  <div class="createdBy">Created By <a href="http://www.dropinks.com">Dropinks</a></div></div>
</div>
<div class="footer">
  <div><a target="_blank" href="http://www.dropinks.com/parallel-scrolling">Read Article</a></div>
  <div><a target="_blank"  href="https://twitter.com/dropinksblog">Twitter</a></div>
  <div><a target="_blank"  href="https://www.facebook.com/dropinksblog">Facebook</a></div>
</div>
            
          
!
            
              .container{position: absolute; left:50%; top: 50%; transform: translate(-50%,-50%); white-space: nowrap;}
.leftContainer{backgound: #ececec; width: 220px; display: inline-block; height: 450px; overflow: hidden; border: 1px solid #777; border-radius: 15px;}
.rightContainer{backgound: #ececec; width: 220px; display: inline-block;  height: 450px; overflow: auto;border: 1px solid #777; border-radius: 15px;}
#lsContainer{position: relative;;}
header{background: #387ef5; padding: 10px 15px; text-align: center; font-size: 22px; font-weight: 400; color: #fff; box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.4)}
article{margin: 15px; padding: 10px 10px; background: #fff; box-shadow: 0px 10px 25px -15px rgba(0,0,0,0.4);border-radius: 4px;border: 1px solid #ddd;}
article a{white-space: initial; color: #387ef5; text-decoration: none; font-weight: 300; font-size: 22px;}
article h2{margin: 0;}





html, body{
  width: 100%; 
  height: 100%; 
  font-family: 'Roboto', sans-serif;
}
body{
  margin: 0;
  background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(239,247,255,1)), color-stop(15%, rgba(239,247,255,1)), color-stop(100%, rgba(180,188,221,1)));
  background: linear-gradient(135deg, rgba(239,247,255,1) 0%, rgba(239,247,255,1) 15%, rgba(180,188,221,1) 100%);
  background: -webkit-linear-gradient(-45deg, rgba(239,247,255,1) 0%, rgba(239,247,255,1) 15%, rgba(180,188,221,1) 100%);
  background: -moz-linear-gradient(-45deg, rgba(239,247,255,1) 0%, rgba(239,247,255,1) 15%, rgba(180,188,221,1) 100%);

}

.projHeader{position: absolute; left: 8%; top: 50%; transform: translateY(-50%);    border-right: 1px solid rgba(0,0,0,0.5);padding-right: 15px;}
.primaryText{font-weight: 300; font-size: 50px; text-shadow: 2px 2px 1px rgba(0,0,0,0.3);}
.secondaryText{font-weight: 300; text-align: right; font-size: 25px;}
.createdBy{font-weight: 300; text-align: right; font-size: 17px; margin-top :10px;}
.createdBy a{color: #000; text-decoration: none; border-bottom: 1px solid #000;}
.footer{position: absolute; right: 8%; top: 50%; transform: translateY(-50%); border-left: 1px solid rgba(0,0,0,0.5);padding-left: 15px;}
.footer a{display: inline-block; font-size: 17px; padding: 7px 0; color: #000; text-decoration: none; }


@media only screen and (max-width: 1200px) {
  .projHeader{position: static; transform: translate(0);}
.primaryText{font-weight: 300; font-size: 30px;text-align: center; margin-top: 10px;}
.secondaryText{font-weight: 300; text-align: center; font-size: 20px;}
  .createdBy{font-weight: 300; text-align: center; font-size: 17px; margin-top :5px;}
.createdBy a{color: #000; text-decoration: none; border-bottom: 1px solid #000;}

.footer{position: fixed; bottom: 0; right: auto; top: auto; left: 0; border-top: 1px solid rgba(0,0,0,0.5); width: 100%; transform: translate(0); border: none; padding: 0; text-align: center; border-top: 1px solid #bfc7e4;}
  .footer div{display: inline-block;}
.footer a{display: inline-block; font-size: 17px; padding: 7px 0; color: #000; text-decoration: none; margin: 0px 20px;}
}
            
          
!
            
              window.onload = function(){
  var lsContainer = document.getElementById("lsContainer");
  var rightContainer = document.getElementById("rightContainer");
  var leftContainerHt = lsContainer.offsetHeight;
  var leftContainerPHt = lsContainer.parentNode.offsetHeight;
  var maxScrollPos = (-1)*(leftContainerHt - leftContainerPHt);
  var scrollValue = 0;
  
  var winWt = rightContainer.clientWidth;
  var clntWt = rightContainer.offsetWidth;
  
  var width = rightContainer.offsetWidth + (clntWt -winWt);
  rightContainer.style.width = width+"px";

function leftContainerScroll(ev){
	var leftContainerTop = lsContainer.offsetTop;
    var ev = ev;
    ev.stopPropagation();
    ev = window.event || ev;
    var deltaY = ev.deltaY;   
    var newTop = leftContainerTop - deltaY;

	if( newTop > 0 ) {
		newTop = 0;
	}
	else if( newTop < maxScrollPos) {
		newTop = maxScrollPos;
	}

    lsContainer.style.top = newTop+"px";
    rightContainer.scrollTop = -(newTop);
}

function rightContainerScroll(){
	var scrollTopPos = rightContainer.scrollTop;
	lsContainer.style.top = -scrollTopPos+"px";
}
lsContainer.addEventListener("wheel", leftContainerScroll, false);
rightContainer.addEventListener("scroll", rightContainerScroll, false);
}
            
          
!
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