Skip to content

Instantly share code, notes, and snippets.

@thadallender
Last active November 11, 2015 16:45
Show Gist options
  • Select an option

  • Save thadallender/e9a58129a82f362032ba to your computer and use it in GitHub Desktop.

Select an option

Save thadallender/e9a58129a82f362032ba to your computer and use it in GitHub Desktop.
Vanishing welcome message on scroll. Tutorial here: https://graphpaperpress.com/?p=74953
jQuery( document ).ready( function( $ ) {
// This is where we apply opacity to the intro overlay
$( window ).scroll( function() {
// Hide the overlay if user has scrolled past 1px from top
if ( $( window ).scrollTop() >= 1 ) {
$( '.vanishing-message' ).removeClass('has-overlay');
$( '.vanishing-message .text' ).css( 'opacity', 0 );
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment