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

136
Views
I have this `div` on my home page and want it to move with me when I scroll, I am using react for the website btw

I have this div on my home page and want it to move with me when I scroll: I tried using position:sticky; and position: fixed and adding top: 600px; but its not moving to the top its stuck at the bottom

.linkss {
  color: #8892b0;
  font-family: 'NTR', sans-serif;
  font-size: 25px;
  right: 10px;
  top: 680px;
  padding-right: 30px;
  position: fixed;
}

.linkss h3 {
  margin: 0px;
  height: 50px;
  color: #c9c1f5;
}

.linkss a {
  border: 0px;
  display: block;
  padding: 0px;
  margin: 0px;
  font-size: 23px;
  padding-left: 30px;
  color: #c9c1f5;
  height: 30px;
  width: 110px;
}
<div className="linkss">
  <h3>/ Links</h3>
  <a href="https://www.etsy.com/ca/shop/VanillaUnlimited">/ Etsy Shop </a>
  <a href="https://www.etsy.com/ca/shop/VanillaUnlimited">/ LinkedIn </a>
  <a href="https://www.etsy.com/ca/shop/VanillaUnlimited">/ Instagram </a>
</div>

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

0

You need to use addEventListener in componentDidMount as below:

componentDidMount() {
  document.addEventListener('scroll', this.doSomething)
}

doSomething = () => {
  if (window.pageYOffset > 100) {
     // add a new class (with top: 0) to element or change style of element by top = 0
  } else {
    // do something else
  }
}
about 4 years ago · Juan Pablo Isaza Report

0

I think it's stuck to the bottom because you have given top:680px; decrease it to something smaller like 20px. And set the position property to position:sticky;

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!