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

Commit e1bd221

Browse files
committed
Make adjustments.
1 parent 0bba460 commit e1bd221

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

js/fixed_navbar.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ if (navbar_maxheight < 1)
6464
}
6565

6666
// Fixed transparently.
67-
var fixed_opacity = 0.7;
67+
var unfixed_opacity = 0.7;
68+
var fixed_opacity = 1.0;
6869

6970
// Check to see if we should just add a custom class to the navbar.
7071
if (nav_addclass.length > 0)
@@ -74,13 +75,14 @@ if (nav_addclass.length > 0)
7475
else
7576
{
7677
// Set general navbar settings for fixed support.
77-
navbars.css('max-height', navbar_maxheight);
7878
navbars.css('z-index', '100');
7979
navbars.css('width', '100%');
8080
navbars.css('top', '0px');
8181
navbars.css('left', '0px');
8282
}
8383

84+
navbars.css('max-height', navbar_maxheight);
85+
8486
// Leaving commented function just because it was somewhat neat.
8587
/*
8688
navbars.each(function(i)
@@ -111,7 +113,7 @@ $(window).scroll(function(e)
111113

112114
if (margin && parseInt(margin) > 0)
113115
{
114-
header_layout.css('margin-bottom', '0px');
116+
header_layout.css('margin-bottom', navbar_maxheight);
115117
}
116118

117119
return;
@@ -125,12 +127,13 @@ $(window).scroll(function(e)
125127
{
126128
if (fix_class.length < 1)
127129
{
128-
navbars.css('background', 'rgba(var(--theme-main_nav), 1.0)');
130+
navbars.css('background', 'rgba(var(--theme-main_nav), ' + fixed_opacity + ')');
129131
navbars.css('position', 'fixed');
130132
}
131133
else
132134
{
133135
navbars.addClass(fix_class);
136+
navbars.removeClass(unfix_class);
134137
}
135138

136139
if (icon)
@@ -149,12 +152,13 @@ $(window).scroll(function(e)
149152
// Revert back to non-fixed navbar.
150153
if (unfix_class.length < 1)
151154
{
152-
navbars.css('background', 'rgba(var(--theme-main_nav), ' + fixed_opacity + ')');
155+
navbars.css('background', 'rgba(var(--theme-main_nav), ' + unfixed_opacity + ')');
153156
navbars.css('position', 'relative');
154157
}
155158
else
156159
{
157160
navbars.addClass(unfix_class);
161+
navbars.removeClass(fix_class);
158162
}
159163

160164
if (icon)

0 commit comments

Comments
 (0)