Jump to content

Html ID of header menu item

Recommended Posts

  • Replies 14
  • Views 1.4k
  • Created
  • Last Reply

image.thumb.png.90471a1da5c18e8f9a3fcb7d99685c6f.png

4 minutes ago, tuanphan said:

nav.header-nav-list>div:nth-child(3) a

 

That is not a html id, but css id? 

I am using Elfsight Apps to create an embedded popup. There I need the html element id for setting the on click trigger. 

Freelancer - Project Manager digital solutions. Recently started to explore Squarespace. My site (not Squarespace): https://metait.no/

Link to comment
3 hours ago, rwp said:

That link doesn't have an html id.

That is correct, but is there a way to acheive this with the header menu? 

Freelancer - Project Manager digital solutions. Recently started to explore Squarespace. My site (not Squarespace): https://metait.no/

Link to comment
12 hours ago, rwp said:

We can give it an ID with jQuery. You have a business or commerce account, correct?


$(document).ready( function() {
	$('nav.header-nav-list>div:nth-child(3) a').attr('id', 'Deltakere2');
});

 

That is a great idea, and it worked! Thank you sir!

Freelancer - Project Manager digital solutions. Recently started to explore Squarespace. My site (not Squarespace): https://metait.no/

Link to comment
2 hours ago, MetaIT said:

That is a great idea, and it worked! Thank you sir!

There is a problem tho... Mobile menu, dosent work 😕 I belive that is because of the id "nav.header-nav-list" is different there. Should I create a new script for this, if so, can you help me out with the content? 

Freelancer - Project Manager digital solutions. Recently started to explore Squarespace. My site (not Squarespace): https://metait.no/

Link to comment
1 hour ago, rwp said:

$(document).ready( function() {
	$('nav.header-nav-list > div:nth-child(2) a').attr('id', 'Deltakere2');
	$('.header-menu-nav-folder-content > div:nth-child(2) a').attr('id', 'Deltakere2');
});

Update the code to this.

Sorry, no magic there 😕

Freelancer - Project Manager digital solutions. Recently started to explore Squarespace. My site (not Squarespace): https://metait.no/

Link to comment
1 hour ago, rwp said:

It worked, its live on your page now.

It seems to have gotten the id. But cant get the popup to work? Like on the desktop. 

Freelancer - Project Manager digital solutions. Recently started to explore Squarespace. My site (not Squarespace): https://metait.no/

Link to comment
25 minutes ago, rwp said:

Unfortunately, I don't know anything about that plugin.

Hey got it to work! Gave the mobile menu item another id and created a new popup module assigned to that id. 

You have been so helpful man, thank you, it is much appreciated! Wish you the best.

Freelancer - Project Manager digital solutions. Recently started to explore Squarespace. My site (not Squarespace): https://metait.no/

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.