Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to replace Home Section 1's background image with Backstretch slideshow in Parallax Pro. http://sridharkatakam.com/replace-home-section-1s-background-image-backstretch-slideshow-parallax-pro/
jQuery(document).ready(function($) {
// Create an array of images that you'd like to use
var images = [
'http://websitesetuppro.com/demos/parallax-pro-copy/wp-content/themes/parallax-pro/images/bg-1.jpg',
'http://websitesetuppro.com/demos/parallax-pro-copy/wp-content/themes/parallax-pro/images/bg-3.jpg',
'http://websitesetuppro.com/demos/parallax-pro-copy/wp-content/themes/parallax-pro/images/bg-5.jpg'
];
$('.home-section-1').backstretch(images, {
fade: 750,
duration: 4000
});
});
$images = apply_filters( 'parallax_images', array( '1', '3', '5' ) );
if ( is_active_sidebar( 'home-section-1' ) ) {
add_action( 'wp_enqueue_scripts', 'sk_enqueue_backstretch' );
function sk_enqueue_backstretch() {
wp_enqueue_script( 'backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/jquery.backstretch.min.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'backstretch-init', get_stylesheet_directory_uri() . '/js/backstretch-init.js', array( 'backstretch' ), '1.0.0', true );
}
}
$images = apply_filters( 'parallax_images', array( '3', '5' ) );
$opts = apply_filters( 'parallax_images', array( '3', '5' ) );
$opts = apply_filters( 'parallax_images', array( '1', '3', '5' ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.