I am totaly new to web development and programming, I want to use Scrollify on my WP site.
So I want to load Scrollify only in one page, so I added this to functions.php
function load_js_assets() {
if( is_page( 26 ) ) {
wp_enqueue_script('scrollify', 'https://goodlifesoft.com/scrollify.js', array('jquery'), '', false);
}
}
I added a message in console to see that the file has been loaded.
I load the latest version of jquery in the header.php
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
I call the Scrollify function in footer.php
<script>
$(function() {
$.scrollify({
section : ".elementor-element.elementor-element.elementor-section-height-full.elementor-section-content-middle.elementor-section-boxed.elementor-section-height-default.elementor-section-items-middle.elementor-section.elementor-top-section",
});
});
</script>
And this is the message that I get in the console.
Contents from console
This is working for me in JSfiddle https://jsfiddle.net/Balodis/w697stj5/60/
I would be very thankfull if someone could point out what I am doing wrong.
Thank you!
2
Answers
If you also run into this issue add jquery in front of the function.
Hope this helps for someone.
Found this thread when trying to implement something similar on my website and got it working – here’s what I did:
I downloaded the scrollify.js script and uploaded it to my wordpress child theme files.
I called the script using the child functions.php
Of course, you will have to edit the “Section” class to the elements you want to scroll between in your own page / layout.