Jump to content

Drop down navigation on mobile

Recommended Posts

Hi! 

I added SERVICES tab onto my navigation and when you click on any of the titles in the dropdown menu it takes you to that section on a single page. This works on desktop in Chrome. But on IOS mobile or desktop Safari no matter what title I tap on, it just takes me to the top of that page. Can anyone help me resolve this?

https://www.alinahetz.com/

Thank you, 

Alina

Edited by AlinaH
Link to comment
  • Replies 3
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Try adding to Settings > Developer Tools > Code Injection > Footer

<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
On 9/27/2023 at 10:51 AM, AlinaH said:

Hi! Tried it but it didn't seem to change anything..

Ah sorry, misread your question

Current click on this >> open sub menu

You want click on this >> open new page without opening sub 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

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.