BYWJ Posted May 14 Share Posted May 14 (edited) Site: https://becomingyouwithjulie.com My search icon image url: https://static1.squarespace.com/static/613ce2c584a12d65875f02ff/t/663d2a386d8c9d3f4e56f193/1715284536428/search-icon-2048x2048-cmujl7en.png I am trying to get rid of the “search” navigation item I have on my mobile site and replace it with a search icon. The problem I am facing is I don’t know how to move navigation items actually OUT of the mobile menu and into the header with the hamburger icon and logo. What I’m going after: My website: I already have code to get rid of the search in the mobile menu. All I need is the code on how to either create or transform the search navigation item into an image (like I have on desktop) and code to move it out of the mobile menu and into the header. But either way here’s the code I’m using: // HIDE HEADER NAV LINKS ON MOBILE // .header-menu-nav-list [data-folder="root"]>div:first-child>div>div:nth-child(6) { display: none !important; } .header-menu-nav-list [data-folder="root"]>div:first-child>div>div:nth-child(6) { display: none !important; } I appreciate any help! Thanks! Edited May 14 by BYWJ Added info Link to comment
tuanphan Posted May 17 Share Posted May 17 (edited) Add this code to Website > Website Tools > Code Injection > FOOTER <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> $(document).ready(function(){ $('<a href="/search"><img src="https://static1.squarespace.com/static/613ce2c584a12d65875f02ff/t/663d2a386d8c9d3f4e56f193/1715284536428/search-icon-2048x2048-cmujl7en.png"/></a>').insertAfter('.header-display-mobile .header-mobile-logo'); }); </script> <style> .header-mobile-logo+ a img { width: 30px; } .header-title.header-title--use-mobile-logo { display: flex; align-items: center; } .header-mobile-logo+a { position: relative; right: 6vw; } </style> Edited May 22 by tuanphan 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!) Link to comment
BYWJ Posted May 20 Author Share Posted May 20 Thanks for the code @tuanphan! This worked really well for mobile, but it also applied to the desktop version. And weirdly, it also uncentered my logo on desktop. Thoughts on how to fix this? Thanks, Julie Link to comment
tuanphan Posted May 22 Share Posted May 22 I updated the code, it missing an ID, you can check again 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!) Link to comment
BYWJ Posted May 22 Author Share Posted May 22 Thanks again for the code @tuanphan. It works perfectly for mobile. But on desktop, it is still uncentering my logo. Thoughts on how to fix this? Thanks, Julie Link to comment
Solution tuanphan Posted May 23 Solution Share Posted May 23 Change this code .header-title.header-title--use-mobile-logo { display: flex; align-items: center; } to this code @media screen and (max-width:767px) { .header-title.header-title--use-mobile-logo { display: flex; align-items: center; } } 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!) 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