Jump to content

Anchor link is not working on mobile

Recommended Posts

Hello, not sure what the problem is but I added an anchor tag linked to an id in one of my pages. In desktop, when i click on this anchor tag my browser opens the new page and sends me to the specific part of the page I need. But on mobile, it simply opens the new page from the beginning.

My website is https://www.anakarinawrites.com/ and it's this particular url https://www.anakarinawrites.com/author#block-yui_3_17_2_1_1664972021996_698108 that just wont open on mobile. Any help?

Link to comment
  • 9 months later...

I'm having the same problem. Links had been working properly previously, but all the sudden only go to the top of the page. Another forum said it's an Apple Issue with a recent update with Safari, but the anchor links aren't working for Chrome mobile either--only on desktop.

Link to comment
11 hours ago, April_P said:

I'm having the same problem. Links had been working properly previously, but all the sudden only go to the top of the page. Another forum said it's an Apple Issue with a recent update with Safari, but the anchor links aren't working for Chrome mobile either--only on desktop.

 

On 8/26/2023 at 6:32 AM, nataliafpereyra said:

Still doesn't work on my iphone or Safari on desktop... I might have to contact Squarespace and see if they have a solution, will post here if I find one!

 

 

On 8/26/2023 at 2:33 AM, OLT said:

I am having the same issue with anchor links not working on the safari browser (mobile or desktop). they worked great for a year and then I tried to install a PipeDrive chat bot and they all stopped working over night. Now all 70+ of my buttons are not working. Would appreciate any advice for https://www.outsidelife.com

use this code to Code Injection > Footer

<!-- by @nhannhot-tuanphan -->
<!-- fix anchor links on iOS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$(document).ready(() => {
function scrollToAnchor(aid){
    var aTag = $(aid);
    $('html,body').animate({scrollTop: aTag.offset().top},'slow');
}

scrollToAnchor(location.hash);
})
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 3 weeks later...

It works on my Android. Do you use iPhone?

You try adding this code to Last Line in Code Injection > Footer

<!-- by @nhannhot-tuanphan -->
<!-- fix anchor links on iOS -->
<script>
$(document).ready(() => {
function scrollToAnchor(aid){
    var aTag = $(aid);
    $('html,body').animate({scrollTop: aTag.offset().top},'slow');
}

scrollToAnchor(location.hash);
})
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 9/26/2023 at 12:51 PM, Aranxza said:

It worked only once after updating the link to just /#menu. I reloaded the page afterwards and it stopped working again.

You try using full url

https://www.goldfinchsebastopol.com/home/#menu

or

https://www.goldfinchsebastopol.com/home#menu

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 2 months later...

Hi there, 

For anyone having problems with this, I created a solution for a client's website and mine. 

Whilst I am testing out the effectiveness of the installation guide this December (2023), I'm offering a 15% discount for testers. You can check it out here:

https://www.maryphilip.com/squarespace-code-shop/p/fix-anchor-link-issue-mobile-squarespace

Discount code: THANKSTESTER for 15% off.

🙂 

Hi 👋 I'm a Squarespace Expert Member, Circle Member & only Squarespace Authorised Trainer in Scotland. Check out my portfolio at Mary Philip.

Hit the little 👍 if I've helped.

Link to comment

Hi there, 

For anyone having problems with this, I created a solution for a client's website and mine. 

Whilst I am testing out the effectiveness of the installation guide this December (2023), I'm offering a 15% discount for testers. You can check it out here:

https://www.maryphilip.com/squarespace-code-shop/p/fix-anchor-link-issue-mobile-squarespace

Discount code: THANKSTESTER for 15% off.

🙂 

Hi 👋 I'm a Squarespace Expert Member, Circle Member & only Squarespace Authorised Trainer in Scotland. Check out my portfolio at Mary Philip.

Hit the little 👍 if I've helped.

Link to comment

Hi there, 

For anyone having problems with this, I created a solution for a client's website and mine. 

Whilst I am testing out the effectiveness of the installation guide this December (2023), I'm offering a 15% discount for testers. You can check it out here:

https://www.maryphilip.com/squarespace-code-shop/p/fix-anchor-link-issue-mobile-squarespace

Discount code: THANKSTESTER for 15% off.

🙂 

Hi 👋 I'm a Squarespace Expert Member, Circle Member & only Squarespace Authorised Trainer in Scotland. Check out my portfolio at Mary Philip.

Hit the little 👍 if I've helped.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.