Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

91
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda