Answer the question
In order to leave comments, you need to log in
Does scrolling work weird?
Hello!
On the site contora.tech/clients/capital/24 , clicking on the logo should scroll to the first screen.
For some reason, it reaches the top, and then rolls back. What to do with it?
At the first screen position: fixed
I make it scroll like this:
$(".logo").click(function(event) {
$('html, body').animate({
scrollTop: 0
}, 1500);
});
Answer the question
In order to leave comments, you need to log in
Your link with the logo falls under this condition
$(document).on('click', 'a[href^="#"]', function (event) {
...
}
<a href="#top" class="logo"><img src="images/logo.png" alt="Еда"></a>
on the<div class="logo"><img src="images/logo.png" alt="Еда"></div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question