Tired of scrolling back up when you've hit the bottom of your blog?
Here is a quick guide on how to add a cute, floating scroll-to-top button to your Tumblr theme. It fades in when you scroll down and glides smoothly back to the top when clicked!
The best part? You only need to copy and paste one thing.
The Step-by-Step
Go to Edit Appearance > Edit Theme > Edit HTML.
Click inside the code box and press Ctrl+F (or Cmd+F on Mac).
Search for (it is usually at the very bottom).
Paste the code below right before the tag.
Update Preview and Save!
The Code
(Copy everything in this box!)
<style> /* --- THE STYLING --- */ #scrollToTopBtn { position: fixed; bottom: 30px; right: 30px; z-index: 999999; /* Sits on top of everything */ border: none; outline: none; background-color: {color:Post Background}; /* Matches your post color */ cursor: pointer; padding: 12px; border-radius: 50%; opacity: 0; /* Hidden by default */ pointer-events: none; transition: opacity 0.4s, transform 0.2s; box-shadow: 0 4px 15px rgba(0,0,0,0.15); border: 1px solid {color:Borders}; } #scrollToTopBtn.show { opacity: 1; pointer-events: auto; } #scrollToTopBtn:hover { transform: translateY(-5px); /* Cute hop effect */ } /* The Icon Settings */ #scrollToTopBtn img { width: 20px; /* Size of the icon */ height: auto; display: block; /* filter: invert(1); <--- UNCOMMENT THIS LINE if you need a white icon! */ } </style> <div id="scrollToTopBtn" onclick="scrollToTop()"> <img src="https://static.tumblr.com/obptcxj/p59mo0l0s/pin.png" alt="Scroll to Top"> </div> <script> var mybutton = document.getElementById("scrollToTopBtn"); // Show button when scrolling down 100px window.onscroll = function() {scrollFunction()}; function scrollFunction() { if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) { mybutton.classList.add("show"); } else { mybutton.classList.remove("show"); } } // Smooth scroll to top function function scrollToTop() { window.scrollTo({top: 0, behavior: 'smooth'}); } </script>
How to Customize
Change the Icon: Look for the line that starts with <img src="…. Replace the URL inside the quotes with any image URL you like!
Change the Color: If your icon is black but your theme is dark, find /* filter: invert(1); … / in the CSS section and remove the / and */ to turn the icon white.
Change the Position: In the CSS section, change bottom: 30px; or right: 30px; to move it around.
It would look super cute on your blog… and even cuter if you tagged me in the caption. Just saying. 👀
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
Now, if you want to change it. Go to your CSS, or find this in your HTML <style> / <style type=css""> and copy paste the code above.
::-webkit-scrollbar { (THIS IS FOR STYLE OF THE SCROLLBAR ITSELF)
width: 10px; (HOW THICK YOU WANT IT TO BE)
background: #000000; (THE BACKGROUND OF THE SCROLLBAR)
}
::-webkit-scrollbar-thumb {
background: #458eff; (THE COLOR OF THE SCROLLBAR)
border-radius: 5px; (HOW CIRCLE YOU WANT YOUR SCROLLBAR TO LOOK LIKE)
}
You can use this website for the color codes.
Disclaimer: The code is not mine, I just heavily tweaked it from the owner.
Also, there are some time that the cursor will change when you hover it over the links. Copy and paste the code over your links section also. It would look something like this a{ or a:hover{
Now, here's the surprising part. If you want to change the image of your cursor, use this code instead:
cursor: url(URL IMAGE OF YOUR CURSOR), auto;
Then, look for any cursor image you want it to be then copy and paste the link to the "URL IMAGE OF YOUR CURSOR", in between the parentheses. The URL should start with https:// for it to work. You may try searching at google or Pinterest with the cursor you want and change the url to it.
You may change the colors of it using this website.
::selection {
color: {color:background}; (THIS IS FOR THE COLOR OF THE TEXT WHILE SELECTING IT)
background: {color:text}; (THIS IS FOR THE BACKGROUND WHILE SELECTING IT)
}
Disclaimer: This code is not included on the theme I am currently using and that I have tweaked it so it can conveniently help you in editing your blog.
hi, which tutorial did you learn/use the tabs for? i can't find one that works the way yours does but if i edit the code myself something messes up, like i'm trying to make it into a theme but then the tabs don't work, thank you!
my tabs tutorial? You can read this article but is a little more difficult than the tutorial itself
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
Hello! I was reading off your radio tabs tutorial page and I had a question about it: I was wondering if its possible to get the content to cover the entire page once the box is checked but keep the sidebar in place? The page I would like to use it on is ppthm. Thank you!
I think the answer is yes. The only rule is that you keep the absolute positioning so the contents cover eachother. If you need to give them other positioning you’ll have to change the checked to change opacity instead of z-index