// Navbar Scrolling $(window).scroll(function() { if ($(document).scrollTop() > 50) { $('.scrolling-navbar').addClass('navbar-scroll'); } else { $('.scrolling-navbar').removeClass('navbar-scroll'); } }); // Mobile Full Navbar $(function(){ $('.navbar-toggle-full, .nav-full').click(function(){ $('.navbar-toggle-full').toggleClass('navbar-on'); $('.nav-full').fadeToggle(); $('.nav-full').removeClass('nav-hide'); }); }); $(document).ready(function() { var moduleHero = $('.module-hero, .module-map'), mobileTest; /* ---------------------------------------------- /* * Mobile detect /* ---------------------------------------------- */ if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { mobileTest = true; } else { mobileTest = false; } /* ---------------------------------------------- /* * Full height module /* ---------------------------------------------- */ $(window).resize(function() { if (moduleHero.length > 0) { if (moduleHero.hasClass('js-fullheight')) { moduleHero.height($(window).height() ); } else { moduleHero.height($(window).height() * 0.5); } } }).resize(); /* ---------------------------------------------- /* * Setting background of modules /* ---------------------------------------------- */ var modules = $('.module-hero, .module, .module-sm, .module-xs, .sidebar'); modules.each(function() { if ($(this).attr('data-background')) { $(this).css('background-image', 'url(' + $(this).attr('data-background') + ')'); } }); /* ---------------------------------------------- /* * Parallax /* ---------------------------------------------- */ if (mobileTest === true) { modules.css({'background-attachment': 'scroll'}); } }); $(document).ready(function() { // imgBg $('.imgBg-holder').each(function() { var b = $(this).children('img').attr('src'); $(this).css('background', 'url("' + b + '")') }); }); // Default $(document).ready(function(){ $('.owl-default').owlCarousel({ nav : true, // Show next and prev buttons navText: ["",""], loop:true, items : 1, autoplay:true, autoplayTimeout:6000, autoplayHoverPause:true, thumbs: false, }); }); /* ---------------------------------------------- /* * Youtube video background /* ---------------------------------------------- */ // $(function(){ // $('.video-player').mb_YTPlayer(); // }); //