JSFiddle - React, Tailwind, and code Playground

by victorxpp

HTML

<div id="Container" class="Container">
    <div id="Const" class="Const"> 
    </div>
    <div id="Main" class="Main">
    </div> 
</div>

CSS

div.Container{
   height: 250px;
   border: 2px solid #F00; 
   width: 600px;
    padding: 3px;
    overflow: auto;
    
    /* POSITION */
    position:fixed;
}

div.Const{
   border: 2px solid #0F0;
   width: 200px; 
    height: 400px;
	float:left;
	position:absolute;
}
div.Main{
  border: 2px solid #00F;
  width: 800px;
  height: 200px;
  margin-left: 220px;
  top:0px;
  float:left;
}

JavaScript

$('#Container').scroll(function() {
    $('#Const').css('left', $('#Container').scrollLeft());
});