buura Posted January 30 Share Posted January 30 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 Solution Share Posted January 30 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; } Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, 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 Share Posted January 30 My testing Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, 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 Author Share Posted January 30 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