HEX
Server: Apache/2.4.41
System: Linux mainweb 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC 2024 x86_64
User: nationalmedicaregrp (1119)
PHP: 8.3.7
Disabled: exec,passthru,shell_exec,system,popen,proc_open,pcntl_exec
Upload Files
File: /home/commandofl/public_html/wp-content/themes/hestia/assets/js/src/init-parallax.js
/**
 * Call parallax script for the layers added in customizer
 *
 * @since 1.1.72
 * @package Hestia
 */

/* global Parallax*/
jQuery( document ).ready(
    function ( $ ) {

        var isMobile = {
            Android: function() {
                return navigator.userAgent.match(/Android/i);
            },
            BlackBerry: function() {
                return navigator.userAgent.match(/BlackBerry/i);
            },
            iOS: function() {
                return navigator.userAgent.match(/iPhone|iPad|iPod/i);
            },
            Opera: function() {
                return navigator.userAgent.match(/Opera Mini/i);
            },
            Windows: function() {
                return navigator.userAgent.match(/IEMobile/i);
            },
            any: function() {
                return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
            }
        };

        $.hestiaParallax = {
            'parallaxMove':function(){
                if( isMobile.any() ) {
                    return;
                }
                var parallaxElement = jQuery('#parallax_move');
                if( parallaxElement.length>0 ) {
                    var scene = document.getElementById('parallax_move');
                    var window_width = jQuery(window).outerWidth();
                    parallaxElement.css({
                        'width':            window_width + 120,
                        'margin-left':      -60,
                        'margin-top':       -60,
                        'position':         'absolute'
                    });
                    var h = jQuery('.page-header').outerHeight();
                    parallaxElement.children().each(function(){
                        jQuery(this).css({
                            'height': h+100
                        });
                    });
                    new Parallax(scene);
                }
            }
        };

        jQuery(window).on( 'load', function(){ $.hestiaParallax.parallaxMove(); } );
        jQuery(window).resize(function(){$.hestiaParallax.parallaxMove();});

    }
);