Archived topic
Adding Simple Animations
9 replies · Started by Lina on January 4, 2023
So I've installed sal js, following the instructions from George at https://www.gmitropapas.com/generatepress-tips-and-tricks/generateblocks/scrolling-animation-effects-in-generateblocks-pro/
Child theme in place, sal files in place... Nothing. To me it seems like it's not initializing at all, but it could be something I'm doing wrong in Wordpress.
I'm trying to start by animating a simple heading, using these attributes: https://ibb.co/cXbwmMk
I also tried using the attributes on an entire container, to see if that was the problem, but still, nothing.
Can anyone tell what I'm doing wrong here? Am I not using the attributes correctly in Wordpress? I'm stumped.
Hi there,
i do not see the the script files being loaded. How did you add the functions and scripts to the site ?
Here are photos of my site directory, David. I uploaded the files manually through the file manager. As far as I can tell, everything is in place, but something must be missing.
Hi Lina,
To clarify, have you added this function in functions.php as instructed in the link you provided?:
function gm_enqueue_sal_scripts() {
wp_enqueue_style( 'sal', get_stylesheet_directory_uri() . '/sal/sal.css' );
wp_enqueue_script( 'sal', get_stylesheet_directory_uri() . '/sal/sal.js' );
wp_enqueue_script( 'sal-init', get_stylesheet_directory_uri() . '/sal/sal-init.js', null, null, true );
}
add_action( 'wp_enqueue_scripts', 'gm_enqueue_sal_scripts' );
Hi, Fernando. Yes. Definitely. https://imgur.com/VD2BgRM
Is the Child Theme the active theme ?
Ahhhh! No, it wasn't. I activated it, but now the heading that I'm testing my first animation on just doesn't appear.
Can the custom attributes be applied to a heading block, or can they only be applied to a Container block?
These are the custom attributes I'm using, just as in George's tutorial. https://imgur.com/a/Lc1OGvQ
Assuming based on the article, it seems that the animation would only work for Containers and not Headline Blocks. Can you try implementing it on a Container and see how it goes?
Okay, I did exactly that and what happened next was that the contents of the entire container disappeared, rather than just the contents of the headline.
If you right click > inspect the home page to open browser developers tools, in its Console tab there are a few errors.
The first and main issue is the 404 on this resource: .../wp-content/themes/generatepress_child/sal/sal-init.js
Can you make sure that the sal-init.js is in the generatepress_child/sal/ folder