• Resolved Snaphaan

    (@snaphaan)


    I can’t seem to get any parallax jquery script to run. Seems to be a general problem with any jquery scripts:

    This is in my functions.php:

    function vaandel_theme_scripts() {
        wp_enqueue_script( 'parallax_main', get_stylesheet_directory_uri() . '/assets/js/jquery.enllax.min.js', array('jquery'), 1.0, true);
    	wp_enqueue_script( 'parallax', get_stylesheet_directory_uri() . '/assets/js/parallax.js', array('jquery'), 1.0, true);
    }
    add_action( 'wp_enqueue_scripts', 'vaandel_theme_scripts',5 );

    Both are loaded but the second part (parallax.js) doesn’t seem to activate or something. According to all the tutorials and guides the scripts should be loaded this way.

    This is the tiny script in Parallax.js:

    $(function() {
    
    $(window).enllax();
    
    });

    tried adding it as <script> into the page itself – nothing.

    This is the html. Not too complicated but for some reason I cannot get it to work. Tried other themes as well as other scripts but nothing. I must be doing something wrong.

    <div class="dem1 bg1" data-enllax-ratio=".5" data-enllax-direction="horizontal"></div>
                <div class="dem1 bg3 text-center" data-enllax-ratio=".7" style="color: #fff;" >
                    <h2>With Some Texts</h2>
                    <p>Some paragraph text</p>
                    <h1 data-enllax-ratio=".5" data-enllax-type="foreground" data-enllax-direction="horizontal">And this is moving horizontally</h1>
                </div>

    Here is the link to Enllax.

Viewing 1 replies (of 1 total)
  • Thread Starter Snaphaan

    (@snaphaan)

    Figured it out:

    I had to replace the “$” sign in the initialization file (Parallax.js) with “jQuery”.

Viewing 1 replies (of 1 total)
  • The topic ‘Storefront Child theme with custom jquery’ is closed to new replies.