Jump to content

Html ID of header menu item

Recommended Posts

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

Hjem: nth-child(1)

Deltakere: nth-child(2)

Deltakere2: nth-child(3)

Aktuelt: nth-child(4)

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

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!

Edited by MetaIT

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? 

Edited by MetaIT

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

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.