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

132
Vistas
using smooth-scroll plugin on a button

I'm using the Smooth-Scroll plugin from the following git - link.

It works great in places like navbar where I used it as follows:

<nav class="navbar">
    <ul>
        <li><a href="#initial">Home</a></li>
        <li><a href="#skills">Skills</a></li>
        <li><a href="#service">Service</a></li>
        <li><a href="#end">end</a></li>
    </ul>
</nav>

<script>
    var scroll = new SmoothScroll('a[href*="#"]');
</script>

However, on the same screen, I have a search button inside a form and I had liked it to act as the navbar - I want that once the user clicks on the search button it will smooth-scroll to the next section.

My form looks like this and I tried the following:

<form method="POST" class="hiscore_query">
    <input type="text" placeholder="username" id="username" autocomplete="off">
    <button type="submit" href="#skills"><i class="fa fa-search"></i></button>
</form>

and I tried to change my js into:

<script>
    var scroll = new SmoothScroll('button[href*="#"]');
</script>

but nothing happens.

Is there any way to make that search button do that smooth scroll?

Thank you

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

<button>s can't be used as links. Change <button type="submit" href="#skills"><i class="fa fa-search"></i></button> to <a href="#skills"><i class="fa fa-search"></i></a>.

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