File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change
1
+ const scrollBtn = document . querySelector ( ".floating" ) ;
2
+
3
+ scrollBtn . addEventListener ( "click" , ( ) => window . scrollTo ( 0 , 0 ) ) ;
Original file line number Diff line number Diff line change @@ -119,6 +119,13 @@ aside {
119
119
display : block;
120
120
}
121
121
122
+ /* FLOATING ACTION BUTTON */
123
+ .floating {
124
+ position : fixed;
125
+ right : 1rem ;
126
+ bottom : 1rem ;
127
+ }
128
+
122
129
/* MAIN CONTENT */
123
130
main {
124
131
margin-left : var (--side-nav-width );
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ <h2 class="side-nav-heading">Components</h2>
47
47
</ aside >
48
48
49
49
< main >
50
+ < button class ="btn btn-dark floating "> Scroll to top ⬆️</ button >
50
51
<!-- Getting Started -->
51
52
< section id ="getting-started ">
52
53
< header class ="section-header "> Getting Started</ header >
@@ -663,6 +664,7 @@ <h2>Center Text</h2>
663
664
<!-- highlight js -->
664
665
< script src ="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.1/highlight.min.js "> </ script >
665
666
< script > hljs . highlightAll ( ) ; </ script >
667
+ < script src ="./app.js "> </ script >
666
668
</ main >
667
669
668
670
You can’t perform that action at this time.
0 commit comments