[Resolved] Parallax effect to HTML element

Home Forums Support [Resolved] Parallax effect to HTML element

Home Forums Support Parallax effect to HTML element

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #119047
    pilxy

    I have added HTML element on my index page and I would like to add parallax effect to the background. I wonder if there is a simple way to do this, using exisiting GP classes?

    #119112
    Tom
    Lead Developer
    Lead Developer

    Nothing built in I’m afraid, but this thread may be helpful: http://generatepress.com/forums/topic/parallax-speed-or-whatever/

    Let me know πŸ™‚

    #119311
    pilxy

    I have made it!

    I used .js from GP http://generatepress.com/wp-content/plugins/gp-premium/addons/generate-sections/inc/js/parallax.js?ver=1.3.04

    Added it to my child theme using this code:

    /*
    * script for parallax 
    */
    add_action( 'wp_enqueue_scripts', 'my_parallax_method' );
    function my_parallax_method() {
    	wp_enqueue_script(
    		'parallax-script',
    		get_stylesheet_directory_uri() . '/js/parallax.js',
    		array( 'jquery' )
    	);
    }

    After that, it was just a matter of selecting the right div classes and some css.

    And now it moves and I’m happy… πŸ™‚

    #119376
    Tom
    Lead Developer
    Lead Developer

    Perfect, glad you figured it out πŸ™‚

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.