i am using following code but it is not working.when i click on a link it goes directly to the target
$('a[href*="#"]:not([href="#"]),.slicknav_menu li a').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top - 64 }, 800); return false; } } });
Here is the address
https://failuer.000webhostapp.com/Project12/Demo8SmootEroor/index.html
i am using following code but it is not working.when i click on a link it goes directly to the target
$('a[href*="#"]:not([href="#"]),.slicknav_menu li a').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top - 64 }, 800); return false; } } });
Here is the address https://failuer.000webhostapp.com/Project12/Demo8SmootEroor/index.html