Skip to content

Commit 76ac125

Browse files
committed
24 - Sticky Nav: reset index and style START
Reset the contents of index-START and style-START to reflect the contents before running through the video.
1 parent 45e08db commit 76ac125

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

24 - Sticky Nav/index-START.html

+1-14
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,7 @@ <h1>A story about getting lost.</h1>
5454
</div>
5555

5656
<script>
57-
const nav = document.querySelector('#main');
58-
const topOfNav = nav.offsetTop;
59-
60-
function fixNav() {
61-
if(window.scrollY >= topOfNav) {
62-
document.body.style.paddingTop = nav.offsetHeight + 'px';
63-
document.body.classList.add('fixed-nav');
64-
} else {
65-
document.body.style.paddingTop = 0;
66-
document.body.classList.remove('fixed-nav');
67-
}
68-
}
69-
70-
window.addEventListener('scroll', fixNav);
57+
7158
</script>
7259

7360
</body>

24 - Sticky Nav/style-START.css

-13
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ body {
2323
transition: transform 0.5s;
2424
}
2525

26-
.fixed-nav .site-wrap {
27-
transform: scale(1);
28-
}
29-
3026
header {
3127
text-align: center;
3228
height:50vh;
@@ -52,11 +48,6 @@ nav {
5248
z-index: 1;
5349
}
5450

55-
.fixed-nav nav {
56-
position: fixed;
57-
box-shadow: 0 5px rgba(0,0,0,0.1)
58-
}
59-
6051
nav ul {
6152
margin: 0;
6253
padding:0;
@@ -81,10 +72,6 @@ li.logo {
8172
font-size: 30px;
8273
}
8374

84-
.fixed-nav li.logo {
85-
max-width:500px;
86-
}
87-
8875
li.logo a {
8976
color:black;
9077
}

0 commit comments

Comments
 (0)