Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d124b95

Browse filesBrowse files
authored
Merge pull request wesbos#47 from msbit/24-sticky-nav-reset-index-and-style-start
24 - Sticky Nav: reset index and style START
2 parents 5b9798f + 76ac125 commit d124b95
Copy full SHA for d124b95

File tree

Expand file treeCollapse file tree

2 files changed

+1
-27
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+1
-27
lines changed
Open diff view settings
Collapse file

‎24 - Sticky Nav/index-START.html‎

Copy file name to clipboardExpand all lines: 24 - Sticky Nav/index-START.html
+1-14Lines changed: 1 addition & 14 deletions
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>
Collapse file

‎24 - Sticky Nav/style-START.css‎

Copy file name to clipboardExpand all lines: 24 - Sticky Nav/style-START.css
-13Lines changed: 0 additions & 13 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.