Skip to content

Commit b2e8e64

Browse files
committed
Disabled sticky nav scroll on browsers < 590px high
1 parent 0b3eb04 commit b2e8e64

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

css/style.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ a.large-link:before {
204204
color: #2c7bb5;
205205
}
206206
.navBar { padding: 0 20px 0 30px; }
207-
.navBar.stuck { position: fixed; top: 20px;}
207+
.navBar.stuck { position: fixed; top: 20px; }
208+
@media only screen and (max-height: 590px) {
209+
.navBar.stuck { position: static; top: 0;}
210+
}
208211

209212
.navBar a { text-decoration: none; border: none; }
210213

javascript/site.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ $(function(){
22

33
// sticky scroll
44
$(window).scroll(function(){
5-
if($(this).scrollTop() > 114){
6-
$('.navBar').addClass('stuck')
7-
} else {
5+
if($(this).scrollTop() < 114){
86
$('.navBar').removeClass('stuck')
7+
} else {
8+
$('.navBar').addClass('stuck')
99
}
1010
})
1111

0 commit comments

Comments
 (0)