// ========== PAGE LOADER ========== // (function($) { "use strict"; $(window).load(function() { $(".loader-img").delay(500).fadeOut(); $("#pageloader").delay(500).fadeOut(1000); }); })(jQuery); // ========== BACK TO TOP SCRIPT ========== // // Button (function($) { "use strict"; $(document).ready(function() { // Action $('a.scrolltotop').on('click', function(e) { // prevent default anchor click behavior e.preventDefault(); // animate $('html, body').stop().animate({scrollTop:0}, 800, 'easeOutExpo'); }); }); })(jQuery); // ========== NAVIGATION - LEFT AND RIGHT NAVS ========== // (function($) { "use strict"; $(document).ready(function(){ // Sub-Menu Activation // $('.nav-left .main-navigation li.menu-item-has-children > a').click(function(e) { e.preventDefault(); $('ul.menu').addClass('second-level'); $(this).parent('li').addClass('active'); }); // Back Button 1 // $('.nav-left .main-navigation li.back-button a').click(function(e) { e.preventDefault(); $('ul.menu').removeClass('second-level'); $('ul.menu li').removeClass('active'); }); // Third-Menu Activation // $('.nav-left .main-navigation ul ul li.menu-item-has-children > a').click(function(e) { e.preventDefault(); $('ul.menu').addClass('third-level'); $('ul.menu').removeClass('second-level'); }); // Back Button 1 // $('.nav-left .main-navigation li.back-button2 a').click(function(e) { e.preventDefault(); $('ul.menu').removeClass('third-level'); $('ul.menu').addClass('second-level'); }); }); })(jQuery); // RIGHT (function($) { "use strict"; $(document).ready(function(){ // Sub-Menu Activation // $('.nav-right .main-navigation li.menu-item-has-children > a').click(function(e) { e.preventDefault(); $('ul.menu').addClass('second-level'); $(this).parent('li').addClass('active'); }); // Back Button 1 // $('.nav-right .main-navigation li.back-button a').click(function(e) { e.preventDefault(); $('ul.menu').removeClass('second-level'); $('ul.menu li').removeClass('active'); }); // Third-Menu Activation // $('.nav-right .main-navigation ul ul li.menu-item-has-children > a').click(function(e) { e.preventDefault(); $('ul.menu').addClass('third-level'); $('ul.menu').removeClass('second-level'); }); // Back Button 1 // $('.nav-right .main-navigation li.back-button2 a').click(function(e) { e.preventDefault(); $('ul.menu').removeClass('third-level'); $('ul.menu').addClass('second-level'); }); }); })(jQuery); // ========== DYNAMICALLY MAKE IMAGE XX% OF SCREEN HEIGHT ========== // (function($) { "use strict"; $(window).on('resize load', function() { var newheight = $(window).height(); $('.height-100').css('height', newheight); var newheight = $(window).height() * .85; $('.height-85').css('height', newheight); var newheight = $(window).height() * .75; $('.height-75').css('height', newheight); var newheight = $(window).height() * .66; $('.height-66').css('height', newheight); var newheight = $(window).height() * .5; $('.height-50').css('height', newheight); var newheight = $(window).height() * .33; $('.height-33').css('height', newheight); var newheight = $(window).height() * .25; $('.height-25').css('height', newheight); }); })(jQuery); // ========== PARALLAX SETTINGS ========== // (function($) { "use strict"; var disablePoint = 1025; if ($(window).width() < disablePoint) { // Do nothing // } else { $(window).load(function(){ //.parallax(xPosition, speedFactor, outerHeight) options: //xPosition - Horizontal position of the element //inertia - speed to move relative to vertical scroll. Example: 0.1 is one tenth the speed of scrolling, 2 is twice the speed of scrolling //outerHeight (true/false) - Whether or not jQuery should use it's outerHeight option to determine when a section is in the viewport $('.parallax').parallax("50%", 0.5, true); }) } })(jQuery); // ========== MAIN SEARCH IN MENU ========== // (function($) { "use strict"; $(document).ready(function() { $('#main-search').click(function(e){ // prevent default anchor click behavior e.preventDefault(); $('#main-search-box').toggleClass('active'); $('#main-search-box .search-field').focus(); $('.nav.menu').removeClass('active'); }); $('#close-search').click(function(){ $('#main-search-box').removeClass('active'); }); }); })(jQuery); // ========== OVERIDES FOR WORDPRESS EMBEDS ========== // (function($) { "use strict"; $(window).on('resize load', function() { var iframeHeight = $('.post-video iframe').width() *.569; $('.post-video iframe').css('height',iframeHeight); var iframeHeight2= $('.post-video iframe').width() *.569; $('.post-video iframe').css('height',iframeHeight2); var iframeHeight2= $('.blog iframe').width() *.569; $('.blog iframe').css('height',iframeHeight2); }); })(jQuery); // ========== VISUAL COMPOSER ITEMS ========== // (function($) { "use strict"; $(document).ready(function(){ $('.pricing-item').parents('.row').addClass('pricing-table'); $('.pricing-item-style2').parents('.row').addClass('pricing-table-style2'); }) })(jQuery); // ========== START BOOTSTRAP CAROUSEL ========== // (function($) { "use strict"; $(document).ready(function() { $('.carousel').carousel({ interval: 5000, pause: "hover", }) }); })(jQuery); // ========== END BOOTSTRAP CAROUSEL ========== // // ========== MAKE SQUARE ========== // (function($) { "use strict"; $(window).on('resize load', function() { $(".square").each(function(){ var imageHeight = $(this).width(); $(this).css('height', imageHeight); }); }); })(jQuery); // ========== MAKE RECTANGLE ========== // (function($) { "use strict"; $(window).on('resize load', function() { $(".rectangle").each(function(){ var imageHeight = $(this).width() *.7; $(this).css('height', imageHeight); }); }); })(jQuery); // ========== MAKE CIRCLE ========== // (function($) { "use strict"; $(window).on('resize load', function() { $(".circle").each(function(){ var imageHeight = $(this).outerWidth(); $(this).css('height', imageHeight).css('border-radius','1000px'); }); }); })(jQuery); // ========== MASONRY LAYOUT - 3 COLUMN ========== // (function($) { "use strict"; $(window).on('resize load', function() { var $container = $('#masonry-3column'); // initialize $container.masonry({ columnWidth: '.col-md-4', itemSelector: '.col-md-4' }); }); })(jQuery); // ========== MASONRY LAYOUT - 4 COLUMN ========== // (function($) { "use strict"; $(window).on('resize load', function() { var $container = $('#masonry-4column'); // initialize $container.masonry({ columnWidth: '.col-md-3', itemSelector: '.col-md-3' }); }); })(jQuery); // ========== MASONRY LAYOUT - 2 COLUMN ========== // (function($) { "use strict"; $(window).on('resize load', function() { var $container = $('#masonry-2column'); // initialize $container.masonry({ columnWidth: '.col-md-6', itemSelector: '.col-md-6' }); }); })(jQuery); // ========== START IMAGE GALLERY SQUARE ========== // (function($) { "use strict"; $(window).on('resize load', function() { $(".img-gallery").each(function(){ var imageHeight = $(this).width(); $(this).css('height', imageHeight); }); }); })(jQuery); // ========== START IMAGE GALLERY RECTANGLE ========== // (function($) { "use strict"; $(window).on('resize load', function() { $(".img-gallery-rectangle").each(function(){ var imageHeight = $(this).width() *.7; $(this).css('height', imageHeight); }); }); })(jQuery); // ========== START IMAGE GALLERY CIRCLE ========== // (function($) { "use strict"; $(window).on('resize load', function() { $(".img-gallery-circle").each(function(){ var imageHeight = $(this).width(); $(this).css('height', imageHeight); }); }); })(jQuery); // ========== MAKE SHOP IMAGES SQUARE ========== // (function($) { "use strict"; $(window).on('resize load', function() { var imageHeight = $(".shop-img").width(); $(".shop-img").css('height', imageHeight); }); })(jQuery); // ========== MAKE SQUARE ========== // (function($) { "use strict"; $(window).on('resize load', function() { $(".square").each(function(){ var imageHeight = $(this).width(); $(this).css('height', imageHeight); }); }); })(jQuery); // ========== MAKE RECTANGLE ========== // (function($) { "use strict"; $(window).on('resize load', function() { $(".rectangle").each(function(){ var imageHeight = $(this).width() *.7; $(this).css('height', imageHeight); }); }); })(jQuery); // ========== MAKE CIRCLE ========== // (function($) { "use strict"; $(window).on('resize load', function() { $(".circle").each(function(){ var imageHeight = $(this).outerWidth(); $(this).css('height', imageHeight).css('border-radius','1000px'); }); }); })(jQuery); // ========== START SCROLLTO SCRIPT - One Page ========== // (function($) { "use strict"; $(function() { // Start Click Funtion $('.menu-item a[href*="#"]:not([href="#"])').click(function() { // Do scrolling animation if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top -57}, 1000, 'easeInOutExpo'); return false; } } // End scrolling animation }); // End Click Function // Do Scrollspy Script $(window).on('scroll load', function() { $('.scrollspy').each(function() { // CALCULATES THE TRIGGER POINT USING THE OFFSET var triggerpoint = $(window).height() * .45 + $(window).scrollTop(); // Call point in Viewport: viewport height * decimal(%) + pixels to top of window var element = $(this).offset().top; // TRIGGERS THE ACTIVE MENU if (element < triggerpoint) { var sectionId = $(this).attr('id'); $('.menu-item a[href*="#' + sectionId + '"]').each(function() { $('.menu-item a').parent().removeClass('current-menu-item'); $(this).parent().addClass('current-menu-item'); }); } }); }); // End Scrollspy }); // ======== IF BUTTONS ARE SET TO SCROLL TO A SECTION ======== // $(function() { $('a.btn[href*="#"]:not([href="#"])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top -57}, 1000, 'easeInOutExpo'); return false; } } }); }); })(jQuery); // ========== MAKE VIDEO BG FULL SIZE ========== // (function($) { "use strict"; $(window).on('resize load', function() { var newheight = $(window).height(); $('.bg-video iframe').css('height', newheight); }); })(jQuery); // Mute Video Bg var tag = document.createElement('script'); tag.src = "//www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player; function onYouTubeIframeAPIReady() { player = new YT.Player('ytplayer', { events: { 'onReady': onPlayerReady } }); } function onPlayerReady() { player.playVideo(); // Mute! player.mute(); } // ========== PORTFOLIO FILTER SCRIPT ========== // // Button (function($) { "use strict"; $(document).ready(function() { // Action $('.portfolio-filter li a').on('click', function(e) { // prevent default anchor click behavior e.preventDefault(); // fade in page loader $("#pageloader").fadeIn(500); $('.portfolio-filter li a').removeClass('filter-active'); $(this).addClass('filter-active'); // delays the sorting feature until pageloader loads setTimeout(function(){ $('.portfolio-item').removeClass('portfolio-active'); var txt = '.'+$(e.target).text().replace(/ /g,''); $(txt).addClass('portfolio-active'); },600); // fade out page loader after sort $("#pageloader").delay(500).fadeOut(500); // animate to top // $('html, body').stop().animate({scrollTop:0}, 800, 'easeOutExpo'); }); }); })(jQuery); // ========== MAKE LINKING IMAGES LOAD IN LIGHTBOX ========== // (function($) { "use strict"; $(document).ready(function() { // Add data attribute to image links $('figure.gallery-item a').attr('data-lightbox', 'gallery-name'); $('.alignnone a img').parent('a').attr('data-lightbox', 'gallery-name'); $('.alignleft a img').parent('a').attr('data-lightbox', 'gallery-name'); $('.alignright a img').parent('a').attr('data-lightbox', 'gallery-name'); $('.aligncenter a img').parent('a').attr('data-lightbox', 'gallery-name'); // Force attachment page to use Lightbox $("figure.gallery-item a img").each( function(){ var src = $(this).attr("src"); $(this).parent("a").attr("href", src); }); $(".alignnone a img").each( function(){ var src = $(this).attr("src"); $(this).parent("a").attr("href", src); }); $(".alignleft a img").each( function(){ var src = $(this).attr("src"); $(this).parent("a").attr("href", src); }); $(".alignright a img").each( function(){ var src = $(this).attr("src"); $(this).parent("a").attr("href", src); }); $(".aligncenter a img").each( function(){ var src = $(this).attr("src"); $(this).parent("a").attr("href", src); }); }); })(jQuery);