Premium Only Content

Javascript & CSS Back To Top Button
Welcome back to another of my 30 Days Of Frontend Challenges videos. In today's frontend challenge, we're going to build an animated back to top button. We'll have the button hidden by default, but once the user starts to scroll, we'll hide it. When the user clicks it, we'll animate the page back to the top.
My website
https://www.pixelrocket.store
Download project files (you need this if you want to code along):
https://www.dropbox.com/s/v2hzlar1pv67f5n/Day%20Eight%20-%20Back%20To%20Top%20Button.zip?dl=0
30 Days Of Frontend Playlist
https://www.youtube.com/playlist?list=PLCvPStjGyw0eIMVhkIyy7Xyu90vNZwjPr
Window.scroll function
https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll
Timestamps
0:00 Intro
1:55 Setup Button HTML
2:50 Setup Button Styling
7:30 Setup Button Javascript
-
LIVE
Eternal_Spartan
2 hours agoLive at 9pm Central! Come Hang Out w/ a USMC Vet Playing HALO! Can't Wait to See Everyone!!
103 watching -
LIVE
Welsh Girl
4 hours ago🔴 Minecraft Basics Explained – DAY 1
17 watching -
LIVE
SynthTrax & DJ Cheezus Livestreams
1 day agoFriday Night Synthwave 80s 90s Electronica and more DJ MIX Livestream Trip-Hop SPECIAL EDITION
628 watching -
4:03:27
FusedAegisTV
8 hours agoRumble Smackdown! #001 Street Fighter 6 $500 Online Tournament
38.6K5 -
55:58
BonginoReport
5 hours agoCan Trump Make TikTok Great Again? (Ep. 20) - Nightly Scroll with Hayley Caronia - 04/04/25
118K71 -
LIVE
Jorba4
1 hour ago🔴Live-Jorba4- COD WARZONE- VERDANSK FRIDAY. Hot drops W/ XxXAztecWarrior and Lumpy Potato X2
145 watching -
4:33:11
Nerdrotic
7 hours ago $27.13 earnedPost-Apocalyptic Woke Hollywood, MineCRAP, CinemaCONNED - Friday Night Tights 348, Chris Gore & Rags
106K14 -
1:00:43
Sarah Westall
4 hours agoThe Greatest Financial Crime in History: How Globalist Central Bankers Did It w/ James Patrick
48.6K2 -
LIVE
IamTyrantt
4 hours ago $0.78 earnedTGIF! HIGH ENERGY VIBES!
72 watching -
13:19
China Uncensored
5 hours agoHow Trump's New Tariffs Are CRUSHING China's Economy
26.6K16