Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit 0bba460

Browse files
committed
Cleanup code and add transparenty fixed support.
1 parent e503646 commit 0bba460

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

js/fixed_navbar.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ if (navbar_maxheight < 1)
6363
navbar_maxheight = 52;
6464
}
6565

66+
// Fixed transparently.
67+
var fixed_opacity = 0.7;
68+
6669
// Check to see if we should just add a custom class to the navbar.
6770
if (nav_addclass.length > 0)
6871
{
@@ -94,6 +97,9 @@ navbars.each(function(i)
9497
// Fixed toggle variable.
9598
fixed = false;
9699

100+
// Position (Y).
101+
var pos = 0;
102+
97103
// Loop through the full window's scroll events.
98104
$(window).scroll(function(e)
99105
{
@@ -119,8 +125,8 @@ $(window).scroll(function(e)
119125
{
120126
if (fix_class.length < 1)
121127
{
128+
navbars.css('background', 'rgba(var(--theme-main_nav), 1.0)');
122129
navbars.css('position', 'fixed');
123-
//navbars.css('margin-bottom', '80px');
124130
}
125131
else
126132
{
@@ -143,6 +149,7 @@ $(window).scroll(function(e)
143149
// Revert back to non-fixed navbar.
144150
if (unfix_class.length < 1)
145151
{
152+
navbars.css('background', 'rgba(var(--theme-main_nav), ' + fixed_opacity + ')');
146153
navbars.css('position', 'relative');
147154
}
148155
else
@@ -178,6 +185,4 @@ $(window).resize(function()
178185
{
179186
header_layout.css('margin-bottom', '0px');
180187
}
181-
182-
return;
183188
});

0 commit comments

Comments
 (0)