Jump to content

Trying to link to a specific section in my menu block

Recommended Posts

Posted (edited)

Is it possible to link to a different menu header section instead of defaulting to the first section? So instead of defaulting to "Dinner", I could directly link to "Lunch" being the selected section?

Screenshot 2024-02-07 at 11.06.42 AM.png

Edited by mflom22
  • Replies 3
  • Views 1.5k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • 2 weeks later...
Posted
On 2/23/2024 at 2:22 AM, Krystan said:

I am having the same issue. Here is the site - https://www.thecompounddefiance.com/sweetwater-chophouse-menu

Suppose you want to change default section to "Drinks"

Use this code to Sweetwater Chophouse Menu Page Header Code Injection

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  jQuery(document).ready(function($){
    setTimeout(function(){
              $('label[role="tab"]:nth-child(3)').click();
              $('label[role="tab"]:nth-child(3)').addClass('menu-select-labels--active');
    $('label[role="tab"]:nth-child(1)').removeClass('menu-select-labels--active');
         }, 2000);
})
</script>

Menu Block Change Default Section 04.jpg Min

Note: You will see number 2000 in the code. It means that after the page has finished loading, 2 seconds later the code will start running.

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!)

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.