Jump to content

Smooth scrolling for anchor links does not work on links in folders

Recommended Posts

Site URL: https://lemon-grape-sy9n.squarespace.com

Hi,

I am strugling with smooth scroll on anchor links placed in folders for my nav menu. The scrolling effect works when you already are in the folder, but when visiting the front page, for then visiting a link in a folder in "about us", the scrolling effect will not work, and the page will not show up (react) to the cursor clicking on the link.

This happens when I place my jquery script in the "Code injection" header. If I remove the code, all links and pages works fine when pointing the cursor, clicking on each page and links. But I really want this code to work, so every anchor link and scroll to top button scrolls to the specific codeblock for each section.

Can someone please help me figuring out what is wrong in the code?

Link to comment
  • Replies 3
  • Views 1.3k
  • Created
  • Last Reply
On 3/13/2021 at 8:31 AM, Hjanrobert said:

Site URL: https://lemon-grape-sy9n.squarespace.com

Hi,

I am strugling with smooth scroll on anchor links placed in folders for my nav menu. The scrolling effect works when you already are in the folder, but when visiting the front page, for then visiting a link in a folder in "about us", the scrolling effect will not work, and the page will not show up (react) to the cursor clicking on the link.

This happens when I place my jquery script in the "Code injection" header. If I remove the code, all links and pages works fine when pointing the cursor, clicking on each page and links. But I really want this code to work, so every anchor link and scroll to top button scrolls to the specific codeblock for each section.

Can someone please help me figuring out what is wrong in the code?

what is your page url

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
  • 2 weeks later...

I have a similar problem too - in an original build of my website back in 2016 my anchor links would smoothly scroll but now they jump immediately, which is a bit jarring.

See "Family", "Wedding" and "Newborn" on this webpage https://www.alexcosseyphotography.com/faqs

I m using the Code image block and the following code:

<div id="family-faqs">
  
</div>

 

Any advice would be greatly appreciated!

Link to comment
17 minutes ago, AlexCossey said:

I have a similar problem too - in an original build of my website back in 2016 my anchor links would smoothly scroll but now they jump immediately, which is a bit jarring.

See "Family", "Wedding" and "Newborn" on this webpage https://www.alexcosseyphotography.com/faqs

I m using the Code image block and the following code:

<div id="family-faqs">
  
</div>

 

Any advice would be greatly appreciated!

I still see the link animating to the end of the page

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.