Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active April 2, 2018 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/445e995e74a9dd40d967bae4df6cdcb1 to your computer and use it in GitHub Desktop.
Save billerickson/445e995e74a9dd40d967bae4df6cdcb1 to your computer and use it in GitHub Desktop.
jQuery(function($){
// Update header on scroll
function updateHeader() {
var offset = 100;
if( $(document).scrollTop() > offset ) {
$('.site-header').removeClass('large');
} else {
$('.site-header').addClass('large');
}
}
updateHeader();
$(window).scroll(function(){
updateHeader();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment