Page Scrolling When Clicking Anchor Tags

Hello, I am having an issue where there seems to be a x related javascript asset causing sections of my website to try and smooth scroll to anchors using # in their hrefs.

For example I have a custom template page that has jQuery tabs displaying some custom post type data with the anchor tags href’s pointing to say #example to display the correlating div element with the ID of “example” the page will try and scroll to the element and jump around. is there a way to disable this behavior? I believe jQuery would normally prevent the default anchor event but it seems x is handling it after the fact.

Thank you,
Zach

Hello Zach,

Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

Best Regards.

http://edgetech.avatar-computing.com/products/testing/

Thank you,
Zach

Hey Zach,

Yes, X does have a smooth scroll functionality for jump links. Regretfully, there’s no way to change nor stop this behavior out of the box. Technically, there might be a way to stop it but this would be quite involved and will get into custom development which is outside the scope of our support.

Thank you for understanding.

Can you at least tell me what file I need to look at, or function name? I can do the development I just need to know where to look.

The file you need is x-body.min.js and it’s located in pro\framework\js\dist\site. The file is minified though so it’s tricky to read the function in there. The reference of that minified file is x-body.js. The function comment is Scroll trigger.

That’s perfect Christian thank you very much!

You’re welcome!

1 Like

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