I'm having a problem with a site I'm creating, the scrolling effect I've made in Js is not working correctly, I put a console.log () to see if the event is at least running, and that's the only problem is that the scroll does not happen. If you can help me, I can help you.
MENU
<ul class="navbar-menu">
<li><a class="scrolling" href="#home">MENU 1</a></li>
<li><a class="scrolling" href="#portfolio">MENU 2</a></li>
<li><a class="scrolling" href="#videos">MENU 3</a></li>
<li><a class="scrolling" href="#contact">MENU 4</a></li>
</ul>
SCRIPT
<script type="text/javascript">
$(document).ready(function () {
$('.scrolling').click(function (e) {
var linkHref = $(this).attr('href');
console.log($(linkHref).offset().top);
$('html, body').animate({
scrollTop: $(linkHref).offset().top
}, 1000);
e.preventDefault();
});
});
Q: My jquery version is 3.1.1.
If you need more information please let me know.
Hug.