Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
emorykole

Harris - Anchor links on mobile

Question

Posted (edited)

I have set up anchor links on a site using the Harris template and following Squarespace's direction to insert code to make anchor links work. I've included the home page slug and the anchor in my links. They work perfectly on desktop, but on mobile they don't go anywhere.

Anyone have a solution? Thanks!

Edited by emorykole
Initial Revision

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 0
Posted (edited)

They also do not work on the Desktop. Can you send Squarespace's direction link?

@emorykole If your site is one page. You only need yoursitename/# anchor, no need to use /home/#anchor.

I will work.

Edited by tuanphan
Initial Revision

Share this post


Link to post
  • 0
Posted (edited)

Yeah I just noticed that too, they used to work fine on desktop but now they aren't anymore.

I followed this article - https://support.squarespace.com/hc/en-us/articles/207842357

So each of my page headers - "What We Do", "Who We Are", "Contact Us", have a code block applied to the h1 with for example

<h1 id="what-we-do">What We Do</h1>

and then in my navigation, I created links that link to /home/#what-we-do

Edited by emorykole

Share this post


Link to post
  • 0

@emorykole If site under 20 pages, you can use both, insert both on the Menu, then use CSS to hide a type of anchor when on these pages, and hide the other type of anchor when on another page.

The code will look like this


/* Anchor link: home */
.page-id1, .page-id2, .page-id3,... {
  .navigation-anchor-1 {display: none;}
}
/* Anchor link: no home */
.page-idx, .page-idy, .page-idz... {
 .navigation-anchor-2 {display: none;}
}

You can also use Main & Secondary Nav for two types of anchor links, so you'll need less CSS (if the template supports).

Share this post


Link to post

Create an account or sign in to comment

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


×
×
  • Create New...