Skip to content

Commit

Permalink
Make header opaque on scroll with javascript
Browse files Browse the repository at this point in the history
Fixes #93
  • Loading branch information
chloe2407 committed Oct 31, 2024
1 parent dc990cf commit e78bb4b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion site/assets/themes/fw-child/resources/js/child-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ var child_logging = true

$(document).data('child_theme_dir', child_theme_dir)

// Scroll event handler
$(window).scroll(function() {
if ($(this).scrollTop() > 50) {
$('#main-header').css('background-color', 'rgba(236, 241, 244, 1)');
} else {
$('#main-header').css('background-color', 'rgba(236, 241, 244, 0.5)');
}
});

//
// HEADER
//
Expand Down Expand Up @@ -189,7 +198,6 @@ var child_logging = true
})

}

if (child_logging == true) {
console.log('end of child-functions.js')
console.log('- - - - -')
Expand Down

0 comments on commit e78bb4b

Please sign in to comment.