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

133
Views
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 answers
Answer question

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 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!