/* global screenReaderText */ /** * Theme functions file. * * Contains handlers for navigation and widget area. */ ( function( $ ) { $(document).ready(function(){ // setTimeout(function(){ tidioChatApi.open(); }, 5000); // HOME VIDEO PARALLAX EFFECT // jQuery(window).on('load scroll', function () { var scrolled = jQuery(this).data('offset') - jQuery(this).scrollTop(); jQuery('.parallax').css('transform', 'translate3d(0, ' + (scrolled * 0.25) + 'px, 0)'); // parallax (25% scroll rate) }); // IMAGE PARALLAX // $window = jQuery(window); if ($(window).width() > 960) { jQuery('section[data-type="background"]').each(function(){ // declare the variable to affect the defined data-type var $scroll = jQuery(this); jQuery(window).scroll(function() { var yPos = $scroll.data('offset') - ($window.scrollTop() / $scroll.data('speed')); // background position var coords = '50% '+ yPos + 'px'; // move the background $scroll.css({ backgroundPosition: coords }); }); }); } else {} $(window).on('load scroll', function() { // add "scroll" class on "body" when scrolling down if ($(window).scrollTop() == 0) { $('body').removeClass('scroll'); // remove class "scroll" if scrolled up } else { $('body').addClass('scroll'); $('.filter-row').addClass('scroll'); } }); $(document).ready(function(){ $('.navbar-toggle').click(function(){ $('section').toggleClass('menu-open'); }); }); // EMERGENCE ELEMENT FADE IN INITIALIZATION // // Initiate Emergence emergence.init({ container: window, reset: false, handheld: true, throttle: 50, elemCushion: 0.05, offsetTop: 0, offsetRight: 0, offsetBottom: 15, offsetLeft: 0, }); }) })( jQuery );