Jump to content

Anchor links jumping past their links on mobile

Recommended Posts

Site URL: https://www.elizameadows.com/services

Hello! I've added anchor links to 3 sections on this page, which are also linked in the dropdown menu under "What I Offer."

 

On mobile, if a user clicks either the "Group Classes" or "Independent Study" links in the dropdown, it jumps past the anchor link to the middle of the content.

 

However, if the user is already on the page, and scrolls back up and selects one of the other options, it jumps to the correct spot.

 

Either way, this creates errors on mobile. Any suggestions for fixing?

Link to comment
  • Replies 5
  • Created
  • Last Reply

I checked your site using an ap the simulates various mobile views. Worked fine each time. I also checked it directly on my Android phone both horzontial and vertical view. The links worked perfectly. I do know that if views while signed in or from config mode, unusual things can happen.  I would like to suggest you add a back to top button or arrow to your site. There is a lot of scrolling to get to the menu, especially from mobile view. If you wish to have one you can see it working here: 

https://christinegregoryphotography.com/  choose captures and the button will be down on the right hand corner both mobile and desktop view. 

This is a very simple back to top button. Just add this code to your site footer in a code block: 

<p><a href="#top" class="t-top"><span class="arrow"></span>Top</a>
<style>
  /* Back to Top */  
.t-top {
    font-weight: 500;
    letter-spacing: 2px;
    font-size: 15px;
    text-transform: lowercase;
    text-align: center;
    line-height: 1.6;
    padding-left: 2px;
    padding-top: 4px;
    position: fixed;
    right: 25px;
    bottom: 60px;
    width: 40px;
    height: 40px;
    z-index: 999;
    background-color: transparent;
    color: #000;
  filter: drop-shadow(8px 8px 8px #666666)
}
.t-top .arrow:before {
      font-family: 'squarespace-ui-font';
    font-style: normal;
    font-weight: 300;
    font-size: 20px;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    content: "\e02d";
    text-align: center;
    display: block;
    vertical-align: middle;
    transform: rotate(-90deg);
    cursor: pointer;
    margin-left: -4px;
  filter: drop-shadow(8px 8px 8px #666666)
}
.t-top .arrow {display:inline;}
</style></p>

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.