Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Strange behavior when loading anchor from URL

Strange behavior when loading anchor from URL 05 Mar 2019 00:58 #51435

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.

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

Last Edit: by robbrich.

Strange behavior when loading anchor from URL 05 Mar 2019 01:32 #51436

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.

Strange behavior when loading anchor from URL 05 Mar 2019 07:31 #51443

  • ced1870
  • ced1870's Avatar
  • Offline
  • Administrateur
  • Administrateur
  • Posts: 20711
  • Karma: 422
  • Thank you received: 2632
Hi
thank you for posting the solution :)
CEd

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

Joomlack Webmaster and Developer
  • Page:
  • 1
Time to create page: 0.186 seconds

Fast and powerful creation, customizable and responsive.

Read More

Qui est en ligne

We have 544 guests and one member online