I have a simple menu with 3 anchor and 1 external link. I am using this for smooth scrolling:
$('.header-menu a').on('click', function (e) {
e.preventDefault();
var target = this.hash,
$target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top - 55
}, 700, 'swing');
});
which works great with anchor links but it doesnt work on external link in the menu. When i remove e.preventDefault();, then it works, but there is weird page flicker when i click on the links.
What is the solution to enable external links? Thanks!