Answer the question
In order to leave comments, you need to log in
How to slow down the scrolling of the page on the site?
There is a navigation menu, each link has an identifier, which denotes a div at the bottom of the page. How do I make when I click on a link, the transition to the div block was not fast, but slow.
Answer the question
In order to leave comments, you need to log in
It is possible like this:
<ul class="nav">
<li><a href="#category-1">Категория 1</a></li>
<li><a href="#category-2">Категория 2</a></li>
<li><a href="#category-3">Категория 3</a></li>
</ul>
<div id="category-1">Описание категории 1</div>
$(function(){
$('.nav a').on('click', function(e){
e.preventDefault();
$('html, body').animate({scrollTop: $($(this).attr('href')).offset().top}, 2000);
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question