Strange behavior when loading anchor from URL

More
5 years 8 months ago - 5 years 8 months ago #51435 by robbrich
Hello
I have this installed on a site, and on the homepage I have created a mini-menu with two links that will scroll to an anchor when clicked. This works as expected, but when I want to link directly to that anchor from a URL on a different page (without using the scrollTo class) it will go to the homepage, display the section I want, but then it will refresh to the top of the page and then scroll to that anchor. When I was testing the functionality on a page that wasn't the homepage this worked, but since moving it to the homepage it has this odd behavior.
Last edit: 5 years 8 months ago by robbrich.

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #51436 by robbrich
I ended up finding the cause of the problem - it was a form that was being pulled in via iFrame and it had this in the loading script: onload="window.parent.scrollTo(0,0)"

I removed that and all is working.

Thanks
Robb
The following user(s) said Thank You: ced1870

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #51443 by ced1870
Hi
thank you for posting the solution :)
CEd

Joomlack Webmaster and Developer

Please Log in or Create an account to join the conversation.

Time to create page: 0.201 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 673 guests and no members online