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

100
Views
Fixed postion horizontal to a certian point js

I am making a horizontal scroll website I have a fixed menu but I want the home button to be get fixed when I get close to it I hope someone understands Idk how to explain it. Here is my code it works on the Y-axis but not on the X-axis.

$(document).scroll(function() {
var x = $(document).scrollTop(), //get page x value 
    header = $("#home");
if(x >= 100)  {
    header.css({position: "fixed", "top" : "0", "left" : "0"});
} else {
    header.css("position", "relative");
}

});

about 4 years ago · Juan Pablo Isaza
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!