magicdustwebsites of Magicdust
11/1/2016 - 11:48 AM

Module with parallax background

Module with parallax background

<section class="module  module--parallax" <?php echo get_sub_field( 'image' ) ? 'style="background-image:url(' . get_sub_field( 'image' ) . ');"' : ''; ?>> <!-- Image field. Return URL. -->
    <div class="container">
        <!-- Module contents -->
    </div>

    <?php wp_enqueue_script( 'cascade-parallax' ); ?>

    <script type="text/javascript">
        jQuery(document).ready(function() {
            jQuery('.module--parallax').cascadeParallax();
        });
    </script>
</section>