Strange behavior when loading anchor from URL
5 years 8 months ago - 5 years 8 months ago #51435
by robbrich
Strange behavior when loading anchor from URL was created 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.
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.
5 years 8 months ago #51436
by robbrich
Replied by robbrich on topic Strange behavior when loading anchor from URL
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
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.
5 years 8 months ago #51443
by ced1870
Joomlack Webmaster and Developer
Replied by ced1870 on topic Strange behavior when loading anchor from URL
Hi
thank you for posting the solution
CEd
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