5
I wanted to know how to do it so that once I click on a page link in the main menu, the page will scroll smoothly to the desired page that was clicked?
Example: http://worksofwisnu.com/theme-preview/katemi/product-layout/
I wanted an example using links, there is a question using buttons here but I’m having trouble converting. I’m starting to study jQuery now.
I have the following code:
<nav class="collapse navbar-collapse clearfix" role="navigation">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="#">Home</a>
</li>
<li><a href="#nos">Sobre nós</a>
</li>
<li><a href="#servico">Serviços</a>
</li>
</ul>
</nav>
<section id="servico" class="wow fadeInUp">
<div class="container">
<div class="row">
<div class="col-md-3 col-sm-3">
<div class="service-content"> <a href="#."><span class="service-icon"><i class="fa fa-desktop img-circle wow flipInX"></i></span></a>
<h3>Responsive Layout</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ultricies vestibulum Graphic river molestie.</p>
</div>
</div>
</div>
</div>
</section>
What you need to do is use the idea of the other answer using the href of the link to search for the id of the target element and switch inside the Animate to scrollTo. I can show you how much more to come and if no one else will answer. However it would be nice to have the definitive HTML with the href and id with the right names.
– Sergio
The site is still under construction, I’m testing some passages ready because I know little of jQuery. It’s a form of study.
– João
In the example of Sérgio the links are "defective", if you click twice or more on the link element1, it keeps trying to find the id and if you click twice or more on the link element2 it goes from one anchor to another successively. easy to "FIX" but if we give scripts ready, no one will want to study deeply to understand how it works. That’s why the forum is full of questions or duplicated questions, because people will ask until they get the script ready.
– CarlosM