Sahil007 Posted September 23, 2021 Share Posted September 23, 2021 (edited) Site URL: https://orchid-guitar-kx7j.squarespace.com/ I have set up a language changer on a clients website through two clickable symbols. It's working perfectly, but now I'm having trouble placing it in the header. I need to scale along with the rest of the header. Ideally I'd want to place it within the header itself. Right now it's just placed on top of the header rather than inside it. Password: 1234 This is the code I'm currently using /*setup language switcher*/ .language { color: #fff; position: absolute; top: 2.8vw; right: 3vw; z-index: 99999; a { color: #fff; &:hover { opacity: 0.8; } } } @media screen and (max-width:800px) { .language { color: #fff; position: absolute; top: 4.9vh; right: 23vw; z-index: 99999; a { color: #fff; &:hover { opacity: 0.8; } } } } https://orchid-guitar-kx7j.squarespace.com/ Edited September 23, 2021 by Sahil007 the url was written twice HoaLT 1 Link to comment
HoaLT Posted September 23, 2021 Share Posted September 23, 2021 46 minutes ago, Sahil007 said: Site URL: https://orchid-guitar-kx7j.squarespace.com/ I have set up a language changer on a clients website through two clickable symbols. It's working perfectly, but now I'm having trouble placing it in the header. I need to scale along with the rest of the header. Ideally I'd want to place it within the header itself. Right now it's just placed on top of the header rather than inside it. Password: 1234 This is the code I'm currently using /*setup language switcher*/ .language { color: #fff; position: absolute; top: 2.8vw; right: 3vw; z-index: 99999; a { color: #fff; &:hover { opacity: 0.8; } } } @media screen and (max-width:800px) { .language { color: #fff; position: absolute; top: 4.9vh; right: 23vw; z-index: 99999; a { color: #fff; &:hover { opacity: 0.8; } } } } https://orchid-guitar-kx7j.squarespace.com/ You could add this customization in Design > Custom Css Hope it work well for you .header-nav { padding-right: 10vh; } .language { top: 10vh; } .lang-no { margin-right: 2vh; } Press 👍 or mark my comment as solution if you find my sharing useful 🆒 Squarespace pinchzoom lightbox plugin (affiliate link) 👁🗨 360 degree photo viewer (affiliate link) Link to comment
Sahil007 Posted September 24, 2021 Author Share Posted September 24, 2021 21 hours ago, HoaLT said: You could add this customization in Design > Custom Css Hope it work well for you .header-nav { padding-right: 10vh; } .language { top: 10vh; } .lang-no { margin-right: 2vh; } Didn't work I'm afraid. The symbols jump up to the top of the page in a white box of its own. Link to comment
Solution HoaLT Posted September 24, 2021 Solution Share Posted September 24, 2021 47 minutes ago, Sahil007 said: Didn't work I'm afraid. The symbols jump up to the top of the page in a white box of its own. After reviewing again your code, you could try again the following steps: Step 1. Javascript: Adding the div class ="language" in the header-inner, you can achieve it by changing one bit of your script in the code injection... from /*setup language switcher with flags*/ $('body').prepend('<div class="language"> to /*setup language switcher with flags*/ $('.header-inner').append('<div class="language"> Step2. Adding Design > Custom Css @media only screen and (min-width: 1024px) { .language { position: absolute; top: 50%; transform: translateY(-50%); } .header-nav-wrapper { padding-right: 100px; } } @media only screen and (max-width: 1023px) { .language { position: absolute; top: 50%; transform: translateY(-50%); padding-right: 50px; } } Hope it works for you! tuanphan and Sahil007 2 Press 👍 or mark my comment as solution if you find my sharing useful 🆒 Squarespace pinchzoom lightbox plugin (affiliate link) 👁🗨 360 degree photo viewer (affiliate link) Link to comment
HoaLT Posted September 24, 2021 Share Posted September 24, 2021 PS: You got 2 jQuery instance on the site, consider to remove one of them and move it into top of header injection BTW, here is the result I got with the update position, both desktop and mobile: tuanphan 1 Press 👍 or mark my comment as solution if you find my sharing useful 🆒 Squarespace pinchzoom lightbox plugin (affiliate link) 👁🗨 360 degree photo viewer (affiliate link) Link to comment
Sahil007 Posted September 24, 2021 Author Share Posted September 24, 2021 21 minutes ago, HoaLT said: After reviewing again your code, you could try again the following steps: Step 1. Javascript: Adding the div class ="language" in the header-inner, you can achieve it by changing one bit of your script in the code injection... from /*setup language switcher with flags*/ $('body').prepend('<div class="language"> to /*setup language switcher with flags*/ $('.header-inner').append('<div class="language"> Step2. Adding Design > Custom Css @media only screen and (min-width: 1024px) { .language { position: absolute; top: 50%; transform: translateY(-50%); } .header-nav-wrapper { padding-right: 100px; } } @media only screen and (max-width: 1023px) { .language { position: absolute; top: 50%; transform: translateY(-50%); padding-right: 50px; } } Hope it works for you! 19 minutes ago, HoaLT said: PS: You got 2 jQuery instance on the site, consider to remove one of them and move it into top of header injection BTW, here is the result I got with the update position, both desktop and mobile: Thank! Now it works just as i need it too! Yeah, I know about that double jQuery, but for some reason the script stopped working when I tried to remove it. As long as it's not breaking anything I'll let it be. HoaLT 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment