$('.mainNav a[href^="#"]').on('click', function (event) {
var target = $(this.getAttribute('href'));
if (target.length) {
event.preventDefault();
$('body').stop(true).animate({
scrollTop: target.offset().top - 130
}, 1000);
}
return false;
});
I attempted to implement the preventDefault()
method but unfortunately, the flickering issue persisted.