Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

90
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda