• So i found this jquery script for parallax https://parallax-scroll.aenism.com/ and wanted to use it on my website. But no matter how many times i tried, reading various how-to include jquery plugins in wordpress and such i can’t get it working.

    I’m still newbie (started working with wordpress 2 weeks ago with some basic html + css + basic php knowledge) so i don’t even know how to check if i even loaded .js file properly :/

    Dropped downloaded .js file to child theme directory/js/ and loaded it in function.php

    function parallax_scripts() {
        wp_register_script('parallax', home_url() . '/js/jquery.parallax-scroll.js', array( 'jquery' ));
        wp_enqueue_script('parallax');
    }
    add_action( 'wp_enqueue_scripts', 'parallax_scripts' );

    As for intiializing plugin i can’t really get what’s it about. Read somehwere that i have to put “call”

    <script type="text/javascript">
            $('.bg-holder').parallaxScroll({
            friction: 0.5
            });
    </script>

    somwhere in html file i will use script on so i put it in index.php.

    Next using siteorigin page builder i added bg-holder class to row with background-image but nothings happend. Spend few hours trying various things i read everywhere but i guess it’s still to early for me so i want to ask her for someone to tell me how i can do it.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Can't make jquery script work.’ is closed to new replies.