This topic is: not resolved
- This topic has 0 replies, 1 voice, and was last updated 4 years ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
Community Forums › Forums › Archived Forums › Design Tips and Tricks › Sticky Message visible when page loads
Tagged: sticky message
I use the jQuery script below to make the Genesis Sticky Message visible after scrolling, but I would like to have the sticky message visible immediately when the page loads (without scrolling). How should the code be changed?
jQuery(function( $ ){
// Show sticky message after 1px
$( document ).on( 'scroll', function() {
if( $( document ).scrollTop() > 1 ) {
$( '.sticky-message' ).fadeIn();
} else {
$( '.sticky-message' ).fadeOut();
}
});
return $('.dismiss').on('click', function() {
$( '.sticky-message' ).remove();
});
});
© 2024 WPEngine, Inc.