SolveigTraeet Posted January 9, 2021 Share Posted January 9, 2021 Site URL: https://caper-badger-3s6d.squarespace.com/blog I currently have a cusstommade search icon (made in illustrator), I only want this search icon to be visible, and when clicked on, the search bar appears. I also want to make this icon a bit smaller. Can anyone help me with this? Link to comment
tuanphan Posted January 10, 2021 Share Posted January 10, 2021 Q1. This will require Business Plan + Script code. Q2. Add to Design > Custom CSS /* resize search icon */ @media screen and (min-width:768px) { div#block-yui_3_17_2_1_1609720252520_14008 { width: 5%; margin: 0 auto; } } 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
SolveigTraeet Posted January 10, 2021 Author Share Posted January 10, 2021 1. I have the Business plan, what script code do I need to be able to accomplish what I want? 2. Thank you @tuanphan, that fixed the size! Link to comment
tuanphan Posted January 12, 2021 Share Posted January 12, 2021 On 1/10/2021 at 7:01 PM, SolveigTraeet said: 1. I have the Business plan, what script code do I need to be able to accomplish what I want? 2. Thank you @tuanphan, that fixed the size! Add to Code Injection Header <style> div#block-yui_3_17_2_1_1609719753415_7376 { display: none; } .t-show { display: block; } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $("div#block-yui_3_17_2_1_1609720252520_14008").click(function(){ $("div#block-yui_3_17_2_1_1609719753415_7376").addClass("t-show"); }); </script> 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
SolveigTraeet Posted January 12, 2021 Author Share Posted January 12, 2021 @tuanphan Thank you for replying with a script code! I am not able to click on the search icon, do you know why? Link to comment
tuanphan Posted January 13, 2021 Share Posted January 13, 2021 22 hours ago, SolveigTraeet said: @tuanphan Thank you for replying with a script code! I am not able to click on the search icon, do you know why? Try again with this code <style> div#block-yui_3_17_2_1_1609719753415_7376 { display: none; } .t-show { display: block; } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function() { $("div#block-yui_3_17_2_1_1609720252520_14008").click(function(){ $("div#block-yui_3_17_2_1_1609719753415_7376").addClass("t-show"); }); }) </script> 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
SolveigTraeet Posted January 14, 2021 Author Share Posted January 14, 2021 @tuanphan Thank you for the code, but it still doesn't work when I inject the code in advanced-> Code injection Header. I don't know why this doesn't work? Link to comment
tuanphan Posted January 17, 2021 Share Posted January 17, 2021 On 1/14/2021 at 7:48 PM, SolveigTraeet said: @tuanphan Thank you for the code, but it still doesn't work when I inject the code in advanced-> Code injection Header. I don't know why this doesn't work? Can you add the code? We can check easier 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
SolveigTraeet Posted January 18, 2021 Author Share Posted January 18, 2021 @tuanphan Thank you for replying! But I have decided to drop the code, and just go for a simpler solution. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.