Archived topic
Container fade-in on scroll
7 replies · Started by Drew on December 16, 2022
Trying to find a straightforward solution for applying a fade-in effect to a container on scroll and what I've found in the support board so far applies to entire page content fade in or a container fade in from page load.
Any suggestions? And is this coming as a default function to GenerateBlocks?
Hi there,
there is this plugin:
https://wordpress.org/plugins/animated-blocks/
Will it be something we add to GB? A: possibly a future Pro feature.
Roger that and thanks for the recommendation David 🙏
You're welcome
David, a follow-up here I think will be useful for anyone else finding the thread is how do I go about disabling the animation via that plugin on mobile? There are no settings options and the plugin author does not maintain a support thread in the WP plugin repo.
Likewise, there is no straightforward CSS to disable.
I could duplicate each parent container and set those to display across queries but that seems like a LOT of work and unnecessary code to load.
Hi Drew,
I'm not sure if this will work, but you can try dequeuing the animation scripts of this plugin.
Try adding this snippet:
add_action( 'wp_enqueue_scripts', 'cu_remove_animation_scripts', 50 );
function cu_remove_animation_scripts() {
if(!is_admin() && is_wp_mobile()){
wp_dequeue_script( 'ab-animate' );
wp_dequeue_script( 'ab-animated-block' );
}
}
Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
Thanks Fernado, I will give that a shot.
You're welcome, Drew!