tuanphan Posted September 3, 2023 Share Posted September 3, 2023 On 8/31/2023 at 7:56 PM, MarkScott said: I have put the following id attribute in the footer of the website (https://sweetdreamslittleones.co.uk😞 <html> <head> <style> h3 {text-align: center;} </style> </head> <body> <p id="15MIN"><h3>Request a free 30 minute call:</h3></p> </body> </html> This is so that whenever anybody clicks on a "Request a free 30 minute call button" throughout the site, they will be taken to the footer. The client also sends out the following link in her emails: https://sweetdreamslittleones.co.uk/home#15MIN This is so that the client can be taken directly to the footer to request a free call. This link and the p id attribute work perfectly in chrome, but they have stopped working on iOS devices. Does anyone know why this is, and if there is an easy way to resolve this problem? Thanks Change your id. Don't start ID with a number, you can change to something like this p id="min15" 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
fkbuilders Posted September 3, 2023 Share Posted September 3, 2023 Can someone from squarespace please explain to me why this is a safari problem and not a squarespace problem? Because I decided to deploy a azure static web app for a quick test and anchor 'jump' links work perfectly fine in safari, squarespace / safari bug test (witty-rock-003f16910.3.azurestaticapps.net This issue needs to be addressed. I decided to move our hosting over to squarespace after the acquisition of google domains and very disappointed that the majority of our website visitors are experiencing a broken anchor tag. ...And yes I am using the full link 'https://www.fkbuildersllc.com/home/#contact' for the button. Why does it have to be full link anyways on squarespace? It has to do a full page reload and is annoying. Link to comment
fkbuilders Posted September 3, 2023 Share Posted September 3, 2023 On 8/30/2023 at 2:19 PM, creedon said: The problem is Safari not Squarespace. Contact Apple customer support and get them to fix their broken browser! Why is this a safari problem? Anchor tag is working fine on safari in mobile with simple test site hosted in azure. squarespace / safari bug test (witty-rock-003f16910.3.azurestaticapps.net Squarespace is not. Link to comment
victory_over_all Posted September 7, 2023 Share Posted September 7, 2023 (edited) I'm having an issue with anchor links on the following site: https://carolechevalier.co.uk On the site linked above, there are links in the Services section which link to particular sections of the English and French Services pages. These links work as intended when testing in the following browsers: ✅ Chrome and Firefox on desktop (macOS) ✅ Chrome on Android But they don't work in the following browsers, instead they send the user to the top of the linked page: ❌ Safari on desktop (macOS) ❌ Chrome and Safari on iPad The template used is Brine, I've turned off Ajax loading through the site styles, the sections I'm linking to are sections within index pages so I'm using their unique id as recommended by Squarespace, "www." prefix has been turned off and I've made sure that the URLs don't include the "www.", and the URLs have a / between the page slug and the #. I've tried a few different ways of writing the URLs, and I've tried using simple code blocks with an empty div and giving that an id instead of using the section id, but each time the result is the same: Works in some browsers, but not in others. Anybody found a fix or workaround yet? I've searched, but a lot of the solutions use code injection, which I can't do as the site is on a Personal plan. Edit: My post was merged with this topic, and it seems like we're all facing the same issue. Safari might not be the only problem though, as I'm seeing it in Chrome on iPad too. To rule out old 7.0 Squarespace sites being the issue, I've also tested on my own site, which is built on 7.1 Fluid Engine, as seen on the following page: https://www.victoryoverall.co.uk/anchor-link-page Each button should link to the relevant section on another page, but the issue persists. Edited September 8, 2023 by victory_over_all Post merged with another similar topic. Additional testing on 7.1 site. Cross-discipline designer aka Victory Over All, Welsh-born and France-based, creating graphic design, branding and illustration.⚔️ No corporate design devoid of character or soul. No buzzword-filled nonsense. Just strong design that hits hard, cuts through the mundane and stands out from the crowd.🔗 victoryoverall.co.uk Link to comment
tuanphan Posted September 11, 2023 Share Posted September 11, 2023 On 9/8/2023 at 1:30 AM, victory_over_all said: I'm having an issue with anchor links on the following site: https://carolechevalier.co.uk On the site linked above, there are links in the Services section which link to particular sections of the English and French Services pages. These links work as intended when testing in the following browsers: ✅ Chrome and Firefox on desktop (macOS) ✅ Chrome on Android But they don't work in the following browsers, instead they send the user to the top of the linked page: ❌ Safari on desktop (macOS) ❌ Chrome and Safari on iPad The template used is Brine, I've turned off Ajax loading through the site styles, the sections I'm linking to are sections within index pages so I'm using their unique id as recommended by Squarespace, "www." prefix has been turned off and I've made sure that the URLs don't include the "www.", and the URLs have a / between the page slug and the #. I've tried a few different ways of writing the URLs, and I've tried using simple code blocks with an empty div and giving that an id instead of using the section id, but each time the result is the same: Works in some browsers, but not in others. Anybody found a fix or workaround yet? I've searched, but a lot of the solutions use code injection, which I can't do as the site is on a Personal plan. Edit: My post was merged with this topic, and it seems like we're all facing the same issue. Safari might not be the only problem though, as I'm seeing it in Chrome on iPad too. To rule out old 7.0 Squarespace sites being the issue, I've also tested on my own site, which is built on 7.1 Fluid Engine, as seen on the following page: https://www.victoryoverall.co.uk/anchor-link-page Each button should link to the relevant section on another page, but the issue persists. You can edit Site Footer > Add a Markdown Block > Use this code <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> TheaDev, Nursamo and victory_over_all 1 2 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
hollykmsmith Posted September 13, 2023 Share Posted September 13, 2023 I'm having issues with my anchor links, which I'm using as dropdown menu items under 'About' within the navigation menu. They work fine on desktop when using Chrome. But on Safari (desktop) as well as mobile and tablet (regardless of whether it's Chrome or Safari) they simply take users to the top of the 'About' page, rather than scrolling to the relevant sections. Here's how I have it set up: I've set up a folder menu item in the top nav bar, titled 'About'. The sub-navigation items are set up as anchor links: Our story (which is at top, so I simply link to the 'About' page, rather than an anchor link) Meet the team (anchor link) What we stand for (anchor link) I've added code blocks at the top of each of these sections with the code: <a name="meet-the-team" class="anchor-link"> </a> and <a name="what-we-stand-for" class="anchor-link"> </a> Then in the page settings, I've used the links https://www.aspiringdental.co.nz/about#meet-the-team https://www.aspiringdental.co.nz/about#what-we-stand-for I also tried just using the URL slug and relevant anchor link (e.g. /about#meet-the-team), rather than the whole URL, but I still get the same issue. I've also added some CSS so it smooth scrolls, rather than jumps - and I've offset the Y axis slightly so the title isn't hidden under the nav menu when it scrolls to that section. // ANCHOR LINK OFFSET .anchor-link { scroll-margin: 200px; } // SMOOTH SCROLL FOR ANCHOR LINKS html { scroll-behavior: smooth; } SO. Any ideas on what's going wrong and why my anchor links only work on desktop (Chrome) and not mobile, tablet or desktop (Safari)? Link to comment
Ziggy Posted September 13, 2023 Share Posted September 13, 2023 You need to define the anchor link with an ID not NAME, change this: <a name="meet-the-team" class="anchor-link"> </a> to this: <a id="meet-the-team" class="anchor-link"> </a> Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com Hire me on Upwork! 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) 🔲 SQSP Themes (Referral link) ✨ Spark Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
hollykmsmith Posted September 14, 2023 Share Posted September 14, 2023 @Ziggy thanks for the suggestion but it's still not working properly, even with 'name' changed to 'id'. The anchor links work if I'm already on the 'About' page, but if I'm coming from a different page, say, the homepage, they just take me to the top of the 'About' page, without scrolling down to the relevant section (same issue across desktop (Safari), mobile and tablet). Link to comment
Ziggy Posted September 14, 2023 Share Posted September 14, 2023 Try changing links from this: /about#meet-the-team to this: /about/#meet-the-team note the extra forward-slash Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com Hire me on Upwork! 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) 🔲 SQSP Themes (Referral link) ✨ Spark Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
thewriterb Posted September 14, 2023 Share Posted September 14, 2023 (edited) Here is what I have found on my site when using Safari. I have one page that I use them on. One near the top of the page, the second mid way down. If I click on the top one it will not take me to the second one. But if I manually scroll down to the second link and click on it, it will work, taking me back to the top link. After that BOTH anchors links work just fine in Safari. If I leave that page and then come back to it, the top no longer works again. My links seem to work with other browsers. website: ofwhitewalls.com Update: If I on either my iPhone or iPad and using Chrome, I still have the same problem as if using Safari. On iMac using Chrome, no problems. Edited September 14, 2023 by thewriterb Link to comment
hollykmsmith Posted September 14, 2023 Share Posted September 14, 2023 @Ziggy unfortunately doesn't make a difference. Really appreciate your input though. Link to comment
victory_over_all Posted September 15, 2023 Share Posted September 15, 2023 On 9/11/2023 at 11:58 AM, tuanphan said: You can edit Site Footer > Add a Markdown Block > Use this code <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> @tuanphan Thank you! It works 🥳🌟🎉 I added the exact code above to the footer, in a Markdown Block, as described. Tested immediately in Safari on macOS, and it worked 👍 For some reason I thought that adding JavaScript wasn't possible in sites on a Personal Plan, even in Markdown blocks. No idea why I've thought that for so long, it's great to see that it's possible! tuanphan 1 Cross-discipline designer aka Victory Over All, Welsh-born and France-based, creating graphic design, branding and illustration.⚔️ No corporate design devoid of character or soul. No buzzword-filled nonsense. Just strong design that hits hard, cuts through the mundane and stands out from the crowd.🔗 victoryoverall.co.uk Link to comment
Neen Posted September 18, 2023 Share Posted September 18, 2023 I'm having the same issue, it seems to work in Chrome and Firefox but not in Safari. Link to comment
Neen Posted September 18, 2023 Share Posted September 18, 2023 The suggestion to contact Apple not SS is not appropriate - everyone needs their sites to work across platforms and it's up to SS to fix this issue. They need to be on top of any changes, and it's up to them to "speak to Apple". Link to comment
LDRO Posted September 19, 2023 Share Posted September 19, 2023 *bump I'm having the exact same issue on my site as well. https://www.innercirclewealth.ca Working in chrome, but not on safari. Link to comment
AlinaH Posted September 19, 2023 Share Posted September 19, 2023 On 9/11/2023 at 5:58 AM, tuanphan said: You can edit Site Footer > Add a Markdown Block > Use this code <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> Hi! This ALMOST solved my issue - my drop down menu navigation worked only on chrome and after I used this code, it scrolls on mobile but a bit past the section needed, but still no action on desktop Safari - it still opens top of page no matter what title I select (under "services"). Is there anything I can adjust to make it work on all software and devices? https://www.alinahetz.com/ Link to comment
morenothing Posted September 19, 2023 Share Posted September 19, 2023 Hey I found this solution on another thread that ended up fixing it for me. 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> LDRO and tuanphan 2 Link to comment
LDRO Posted September 19, 2023 Share Posted September 19, 2023 @morenothing it worked for me by creating a markdown block in my footer and adding the code you recommended (I have a personal plan, so I'm not able to paste that code into the code injection field). Thanks! Link to comment
April_P Posted September 20, 2023 Share Posted September 20, 2023 A site I worked on for a client that owns a wedding venue is also having this issue. Anchor links worked fine on mobile up until a few weeks ago. Now they just take you to the top of the page. They work great on desktop, but it doesn't matter if it is Chrome or Safari for mobile, it's not working. Their entire online guest info "book" is built this way, with QR codes throughout the venue linking to different specific anchors on the page. I've read other threads that were "solved" saying it was an Apple Update issue, yet this seems to be an ongoing issue not just with Safari. Will be following this thread to see if there is a real solution to implement other than having to create individual pages in the site! Link to comment
Turbiville Posted September 20, 2023 Share Posted September 20, 2023 On 9/15/2023 at 4:46 AM, victory_over_all said: @tuanphan Thank you! It works 🥳🌟🎉 I added the exact code above to the footer, in a Markdown Block, as described. Tested immediately in Safari on macOS, and it worked 👍 For some reason I thought that adding JavaScript wasn't possible in sites on a Personal Plan, even in Markdown blocks. No idea why I've thought that for so long, it's great to see that it's possible! what is a "markdown block"? Many of use chose to move to Squarespace so we don't have to code or know this terminology. It would be helpful when providing solutions to assume that since Squarespace markets itself as drag and drop, that those of us that need help don't know CSS or code at all. Link to comment
Turbiville Posted September 20, 2023 Share Posted September 20, 2023 Ok I looked it up and the Markdown Block is a block just like adding a picture, shape, or anything else. It's basically an empty text field to add code. I did try following the suggestion to add in the footer a Markdown Block with the following code and still Safari breaks the link when not on the home page. <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> Link to comment
digitalnomadin Posted September 21, 2023 Share Posted September 21, 2023 Hi, on one of my clients websites, I'm using anchor links zu move from the main navigation to different sections on the page. Those anchor links seem to work just fine on Google Chrome and Firefox but not on Safari. Any hints why they are not working on Safari? I'm a bit clueless after trying several options. Website: https://www.insolvenzordnung.at/ Thankful for any advice! Link to comment
Florian Posted September 26, 2023 Share Posted September 26, 2023 Still happening for me. Any news someone?… Florian Zellweger florianzellweger.ch — florianzellweger.com influenz.design — janvier.black — ivoire.black Link to comment
hollykmsmith Posted September 29, 2023 Share Posted September 29, 2023 @tuanphan are you able to elaborate on your above code shared by @morenothing? How does it actually work? I'm still in the dark as to what the actual issue is and why the anchor links aren't working in the first place. Link to comment
TheaDev Posted September 29, 2023 Share Posted September 29, 2023 (edited) Steps to recreate: Open my site in Safari Click on any navigation (anchor) link The page will refresh and remain on the homepage event though the url slug changes My site is already live. https://www.chasingprospects.com/ Edited September 29, 2023 by TheaDev added site URL Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment