lisapastore Posted September 24, 2022 Posted September 24, 2022 (edited) Site URL: https://www.perlamoredielda.com/ Hello everyone. I have two folders on my site. One is called Inspiration and the other the folder named "Ispirazione". They are identical however Ispirazione is not displaying the dropdown menu when clicked on, on mobile devices. I asked squarespace for help and they told me the problem was code related and could not help. The only code I have is page head code injections because my site is bilingual so I put the bellow code to hide English or the Italian respectively. I changed the order of my layout and instead of page numbers in the code I used to odd/even. Now both drop down menus are not working properly. In English I see music and in Italian I see nostri libretti and attività gironaliere. Before I had my layout pages 1-7 in English and 8-14 in Italian. in the code instead of odd and even I put the actual page numbers. <style> @media screen and (max-width:1511px){ #header .header-menu-nav-item:nth-child(odd){ display:none } #header .header-menu-nav-item:nth-child(even){ display:none } I was given this code to input for folders but I cannot seem to get it to work. English is odd pages, Italian are even pages. <style> .Mobile-overlay-nav-item:nth-child(odd){ display: none; } .Mobile-overlay-nav-folder[data folder="root"]>.Mobile-overlay-nav-folder-content>div:nth-child(even){ display: none; } </style> Any suggestions would be appreciated Edited September 24, 2022 by lisapastore i made a change in the codes and now it is worse
creedon Posted October 31, 2022 Posted October 31, 2022 It appears to be working for the most part to me. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
florenciagodoy Posted February 11, 2023 Posted February 11, 2023 Hi! I have the same issue in this site:https://www.headwaytranslations.com/ Have you found a solution?
Solution creedon Posted February 11, 2023 Solution Posted February 11, 2023 7 hours ago, florgodoyf said: I have the same issue in this site The issue is that SS menus are a bit complex. There are two menu structures in a site. One for desktop and one for mobile. The mobile one is complex in itself because of it's panel like presentation. Using the .header-nav-item class alone is not going to work. Use the following code which is more explicit about what is happening where and removes the need for media queries. <style> /* spanish navigation, hide english */ /* desktop */ .header-nav .header-nav-item:nth-child( 6 ), .header-nav .header-nav-item:nth-child( 7 ), .header-nav .header-nav-item:nth-child( 8 ), .header-nav .header-nav-item:nth-child( 9 ), .header-nav .header-nav-item:nth-child( 10 ), .header-nav .header-nav-item:nth-child( 11 ), /* mobile */ .header-menu [data-folder="root"] .header-menu-nav-item:nth-child( 6 ), .header-menu [data-folder="root"] .header-menu-nav-item:nth-child( 7 ), .header-menu [data-folder="root"] .header-menu-nav-item:nth-child( 8 ), .header-menu [data-folder="root"] .header-menu-nav-item:nth-child( 9 ), .header-menu [data-folder="root"] .header-menu-nav-item:nth-child( 10 ), .header-menu [data-folder="root"] .header-menu-nav-item:nth-child( 11 ) { display : none; } </style> <style> /* english navigation, hide spanish */ /* desktop */ .header-nav .header-nav-item:nth-child( 1 ), .header-nav .header-nav-item:nth-child( 2 ), .header-nav .header-nav-item:nth-child( 3 ), .header-nav .header-nav-item:nth-child( 4 ), .header-nav .header-nav-item:nth-child( 5 ), .header-nav .header-nav-item:nth-child( 12 ), /* mobile */ .header-menu [data-folder="root"] .header-menu-nav-item:nth-child( 1 ), .header-menu [data-folder="root"] .header-menu-nav-item:nth-child( 2 ), .header-menu [data-folder="root"] .header-menu-nav-item:nth-child( 3 ), .header-menu [data-folder="root"] .header-menu-nav-item:nth-child( 4 ), .header-menu [data-folder="root"] .header-menu-nav-item:nth-child( 5 ), .header-menu [data-folder="root"] .header-menu-nav-item:nth-child( 12 ) { display : none; } </style> Note my use of the [data-folder="root"] selector. That targets the mobile menu top level elements leaving the sub elements alone. Let us know how it goes. Johansson and florenciagodoy 1 1 Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
florenciagodoy Posted February 12, 2023 Posted February 12, 2023 @creedon Thank you so much! That worked. creedon 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment