Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

95
Views
Using main scrollbar to scroll inner div then scroll rest of page

I have a container div right-col inside of my hero div, that holds two inner divs. The inner divs are sticky and the container div is scrollable to give the illusion of cards sliding up.

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>
<body>
    <div class="hero">
        <div class="left-col">h</div>
        <div class="right-col">
            <div class="top">1st card</div>
            <div class="bottom">2nd Card</div>
        </div>
    </div>
    <div class="projects">a</div>
    <div class="contact-footer"></div>
    <div></div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">

</script>
</html>

CSS:

body{
    overflow: auto;
    background-color: black;
}
.hero {
    display: flex;
    flex-direction: row;
}

.left-col{
    width: 40vw;
    background-color: black;
    height: 100vh;
}
.right-col{
    min-width: 60vw;
    background-color: blue;
    overflow: auto;
    height: 100vh;
}
.top{
    height: 100vh;
    background-color: chartreuse;
    position: sticky;
    top: 0;
}
.bottom{
    height: 100vh;
    background-color: orange;
    position: sticky;
    top: 10%;
}

.projects{
    height: 100vh;
    background-color: crimson;
    position: sticky;
    top: 0;
}

However, the scroll bar is on the inside of the div right-col and independent from the main scrollbar. Is there a way that I can use the main scrollbar to scroll through the container div till it reaches the bottom then continues to scroll through the rest of the page? Possibly using js or jquery?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You could try adding the following css. It will make the inner scroll bar 0 width, so basically it will be invisible but still work.

.hero ::-webkit-scrollbar {
  width: 0px;
}

If you need something more specific you could try using the scroll event to possibly synchronize both scroll bars or something.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!