<body>
<div class="container" style="overflow-y:scroll, width:100%,height:500px">
<div class="overFlow" style="width:60%,height:"1000px,background-color:red,display;flex,align-items:center,justify-content:space-between">
</div>
<div class="formCContainer" style="width:40%">
<form>
<label style="width:100%">
<input placeholder="enter your name" type="text/>
</label >
<label style="width:100%">
<input placeholder="enter your password" type="password"/>
</label>
<button typle="submit">Submit</button>
</form>
</div>
</div>
</body>
As you can see in the code above, I have defined three divs under the body tag: the first div has 100% width and height of 500px; the second div is a child of the first div and has 60% width and height of 1000px, causing it to overflow; and the last div has 40%. Now I want that when users scroll, they first finish scrolling div.overFlow, and then after finishing that, they are able to scroll body.
Please do do not recommend jQuery solutions.
UPDATED ANSWER
OP needed a sticky sidebar. If someone stuck in this same problem just keep reading. Checkout the code-sandbox for hands on apporoch.
We could easily use CSS property
positionto achieve this result.OLD ANSWER
The behavior you describe is usually achived by setting CSS
overscroll-behaviortoauto