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

87
Views
JavaScript I want to navigate to another page

I need to know what to do exactly. I'm editing a template and I want to add some items in the nav-bar to redirect me to an outer page. it works fine the full size page but in mobile size it don't it only move me in the same page. this is the function that responsible for the operation:

var OnePageNavigation = function() {
    var navToggler = $('.site-menu-toggle');
    $("body").on("click", ".main-menu li a[href^='#'], .smoothscroll[href^='#'], .site-mobile-menu .site-nav-wrap li a", function(e) {
      e.preventDefault();

      var hash = this.hash;

      $('html, body').animate({
        'scrollTop': $(hash).offset().top
      }, 600, 'easeInOutExpo', function(){
        window.location.hash = hash;
      });

    });
  };

and this is the template: https://technext.github.io/banker/index.html this is the source: https://github.com/technext/banker

what can I add to the function or the code to allow me to navigate to outer pages?

Sorry if my explanation was bad my English is not the best

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

0

All you need to do is to set the body's scroll-behaviour to smooth in CSS. Then set the href of the navbar links to #section_name.

There is a w3schools documentation here. Fare thee well.

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!