Site logo

Archived topic

Parallax effect to HTML element

3 replies · Started by Anonymous on July 6, 2015

Viewing posts 1–4 of 4

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?

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... :)

Perfect, glad you figured it out :)

This archived topic is closed to new replies.