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

147
Views
Prevent jump to top on anchor click

I'm trying to prevent the page jump when clicking on a link.

CODE UPDATE

$(document).on("click", "#mapbase" , function(e) {
    e.preventDefault();
    id = window.location.hash.substring(1);
    $('.map_tabs').attr("style", "display:none");
    
    if ( $('.map_tabs#' + id).length ) {
        $('.map_tabs#' + id).attr("style", "display:block");
    } else {
        $('.map_tabs#contact-us').attr("style", "display:block")
        $('.map_tabs#contact-us h2').text(id + ' Projects Coming Soon');
    }
});

I've tried adding e.preventDefault() but it's not stopping the page jump.

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!