buura Posted January 30, 2023 Share Posted January 30, 2023 hi. I created a "back to top" button for my website. it's just a circle actually. I want to add an arrow into the circle to make it more clear. here is my codes: -TO THE HEADER- <a href="#" class="btt"> <span class="btt-icon"></span> </a> - TO THE FOOTER - <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> var scrolled = 400; $(window).scroll(function() { if ( $(window).scrollTop() > scrolled ) { $('a.btt').fadeIn('slow'); } else { $('a.btt').fadeOut('slow'); } }); </script> <script> $('a.btt').click(function() { $('html, body').animate({ scrollTop: 0 }, 700); return false; }); </script> - CSS - a.btt { display: block; position: fixed; z-index: 999; width: 45px; height: 45px; right: 30px; bottom: 30px; background: white; -webkit-border-radius: 30px; -moz-border-radius: 30px; border-radius: 30px; box-shadow: 3px 3px 10px rgba(23, 25, 25, 0.2); transition: transform 0.3s ease-in-out; } Link to comment
Solution Beyondspace Posted January 30, 2023 Solution Share Posted January 30, 2023 1 hour ago, buura said: hi. I created a "back to top" button for my website. it's just a circle actually. I want to add an arrow into the circle to make it more clear. here is my codes: -TO THE HEADER- <a href="#" class="btt"> <span class="btt-icon"></span> </a> - TO THE FOOTER - <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> var scrolled = 400; $(window).scroll(function() { if ( $(window).scrollTop() > scrolled ) { $('a.btt').fadeIn('slow'); } else { $('a.btt').fadeOut('slow'); } }); </script> <script> $('a.btt').click(function() { $('html, body').animate({ scrollTop: 0 }, 700); return false; }); </script> - CSS - a.btt { display: block; position: fixed; z-index: 999; width: 45px; height: 45px; right: 30px; bottom: 30px; background: white; -webkit-border-radius: 30px; -moz-border-radius: 30px; border-radius: 30px; box-shadow: 3px 3px 10px rgba(23, 25, 25, 0.2); transition: transform 0.3s ease-in-out; } You can add the following code to get the arrow a.btt { background-image: url('https://api.iconify.design/material-symbols/arrow-upward.svg?color=%23626262'); background-repeat: no-repeat; background-position: center center ; background-size:contain; } BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Beyondspace Posted January 30, 2023 Share Posted January 30, 2023 My testing BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
buura Posted January 30, 2023 Author Share Posted January 30, 2023 5 minutes ago, Beyondspace said: You can add the following code to get the arrow a.btt { background-image: url('https://api.iconify.design/material-symbols/arrow-upward.svg?color=%23626262'); background-repeat: no-repeat; background-position: center center ; background-size:contain; } thanks! Beyondspace 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