Anchor links in menu not scrolling when clicking them in a sub page

Hi, I hope that someone can help me a bit.
I use a custom theme with Beaver Builder Page Builder. There I have a menu with anchor links. All anchors are defined on the startpage. So when I am on my startpage all links scroll fine to the anchors.
But when I am on a subpage and click the menulink it takes me directly to the anchor section without scrolling to that section.
On another site I use the Beaver Builder + Beaver Theme. There the anchor links in menu are working fine without that I had to do something.
I think that this is some JS stuff that is missing in my theme.
Can anybody help me to get this working?

Thanks a lot
elmar

Hi, meanwhile I found something that solved my problem.
I had to add some jQuery code:

if(window.location.hash){
		// smooth scroll to the anchor id
		$('html,body').animate({
			scrollTop:$(window.location.hash).offset().top + 'px'
		},1000,'swing');
	}

Now it works is like I want it (as far as I can see now)…

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.