Ignacik Posted September 1, 2020 Share Posted September 1, 2020 Site URL: https://caribou-brass-k4nh.squarespace.com/config/settings Hi, wondering if anyone can help with some code. I would like this text box on the left to be sticky. This is a very long page and easier if this was always visible. It is the only page that features this list. Hi, I am wondering if anyone can help Link to comment
tuanphan Posted September 1, 2020 Share Posted September 1, 2020 Can you share link to exact page? /config is url for site owner 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
Ignacik Posted September 1, 2020 Author Share Posted September 1, 2020 Hi, thanks for getting back to me, here is another link. Its on the Services page https://caribou-brass-k4nh.squarespace.com/ Link to comment
erinbennetto Posted October 6, 2020 Share Posted October 6, 2020 Hi @tuanphan and @Ignacik! I see that you solved this problem - do you mind sharing how you did so? Link to comment
RSA Posted January 21, 2021 Share Posted January 21, 2021 Hi, I can see that you managed to achieve a sticky text box with anchor links to the rest of the page on your site. Do you mind sharing how you did this/what code you need? Link to comment
tuanphan Posted January 23, 2021 Share Posted January 23, 2021 On 1/21/2021 at 9:32 PM, RSA said: Hi, I can see that you managed to achieve a sticky text box with anchor links to the rest of the page on your site. Do you mind sharing how you did this/what code you need? The site used this code <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <style> @media screen and (min-width: 641px) { #block-yui_3_17_2_1_1593394634180_14692 div { position: fixed; z-index: 1997; } } .Main-content { padding: 0 80px 90px 80px !important; } </style> <script> $(document).ready(function() { var services = $($('#block-yui_3_17_2_1_1593394634180_14692 div')[0]) var heigh = $('.Footer').height() var header = $('.Header').height() window.addEventListener('scroll', function() { if (window.innerWidth >= 641) { if (window.scrollY + window.innerHeight + heigh + 90 > $('body').height()) { services.css("bottom" ,`${90 + heigh}px`) } else { services.css("bottom" , "unset") } if (window.scrollY > header) { services.css("top" ,"20px") } else { services.css("top" , "unset") } } }) }) </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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.