I have added the skrollr script to a wordpress site. I believe it's done correctly and the script loads correctly/shows in inspector. Here's the code...
function creationsphere_enqueue_scripts() {
if (!is_admin()){
wp_enqueue_script( 'skrollr_js', get_stylesheet_directory_uri() . '/js/skrollr.min.js', array(), NULL, true);
}
}
add_action( 'wp_enqueue_scripts', 'creationsphere_enqueue_scripts');
I'm using a purchased wordpress theme so I want to keep my own scripts and alterations to a child theme. So I have the script in a 'js' folder inside the child theme, and get_stylesheet_directory_uri() points to the child theme.
So that's all working but according to the help i've been following i now need to call the script (initialise it). The code is...
// Init Skrollr
var s = skrollr.init({
forceHeight: false
});
The problem is it doesn't explain where to put this and I don't know where? I believe it said to add it to another .js file like main.js, but I want to keep everything in the child theme directory.
Could anybody please help me with this? Many thanks!