Skip to content

Commit 155f6ba

Browse files
feat: sticky header scroll up threshold added
1 parent 9179019 commit 155f6ba

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "timbercss",
3-
"version": "0.1.82",
3+
"version": "0.1.83",
44
"author": "UnlimitDesign",
55
"description": "A CSS Framework for Rapid Website Prototyping",
66
"keywords": [],

src/js/plugins/_tm.stickyheader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright © UnlimitDesign 2019
22
// Plugin: Sticky Header
3-
// Version: 1.0.0
3+
// Version: 1.0.1
44
// URL: @UnlimitDesign
55
// Author: UnlimitDesign, Christian Lundgren, Shu Miyao
66
// Description: Detect when elements enter and/or leave viewport
@@ -126,7 +126,7 @@ const tmStickyHeader = (function () {
126126
classList(header).addClass(plugin.settings.headerInClass);
127127
}
128128
if(thresholdStickyScrollUp){
129-
classList(header).addClass(plugin.settings.headerOutClass);
129+
if (currentPos >= header.offsetHeight) classList(header).addClass(plugin.settings.headerOutClass);
130130
}else{
131131
classList(header).removeClass(plugin.settings.headerOutClass);
132132
}

0 commit comments

Comments
 (0)