// call jRespond and add breakpoints var jRes = jRespond([ { label: 'mobile', enter: 0, exit: 767 },{ label: 'tablet', enter: 768, exit: 999 },{ label: 'desktop', enter: 1000, exit: 10000 } ]); $(document).ready(function(){ //Primay Navigation Dropdowns $('#primary-nav > ul > li').hoverIntent(primaryNavConfig); // Hero Banners $("#home-banner").flexslider({directionNav: false}); $(".home-hero").flexslider({directionNav: false}); //IE Placeholder/Value $("[placeholder]").focus(function(){ var input = $(this); if(input.val() == input.attr("placeholder")){ input.val(""); input.removeClass("placeholder"); } }); $("[placeholder]").blur(function(){ var input = $(this); if(input.val() == "" || input.val() == input.attr("placeholder")){ input.addClass("placeholder"); input.val(input.attr("placeholder")); } }); $("[placeholder]").parents("form").submit(function(){ $(this).find("[placeholder]").each(function(){ var input = $(this); if(input.val() == input.attr("placeholder")){ input.val(""); } }); }); // Form Validation $('form#rfs, form#rfq, form#contact, form#quickContact').validate({onkeyup: false}); $('#defaultReal').realperson(); $(".mobile-menu-btn").on('click', function($e) { $e.preventDefault(); $(this).toggleClass('active'); $('#mobile-btns').slideToggle('fast'); }); $(".expander1").click(function(){ if(!$(this).hasClass("application-open")){ $(".application-content").slideToggle(); $(this).addClass("application-open"); } }); // Gallery Slider $(".gallery-slider").bxSlider({ pager: false, nextText: '', prevText: '', slideWidth: 108, minSlides: 2, maxSlides: 6, slideMargin: 3, infiniteLoop: false }); ///////////////////////////////////// Responsive JS // Desktop Only jRes.addFunc({ breakpoint: ['desktop'], enter: function() { // Image Hover Effect $(".gallery .slide a").hover(function(){ $(this).find("img.gray-img").fadeIn(); },function(){ $(this).find("img.gray-img").fadeOut(); }); // Colorbox $('.gallery .slide a').colorbox({maxWidth:"1000px"}); }, exit: function() { } }); // Desktop & Tablet jRes.addFunc({ breakpoint: ['desktop','tablet'], enter: function() { // Contact Box Exapnder $('.location-map-window:first').parents('.box').addClass('active'); $('.box').not('.active').find('.location-map-window').hide(); // $('.location-map-window').hide(); $('.box').click(function(){ if (!$(this).hasClass('active')) { $('.active .location-map-window').slideToggle().parents('.box').removeClass('active'); $(".location-map-window", this).slideToggle().parents('.box').addClass('active'); }; }); }, exit: function() { } }); // Desktop & Tablet jRes.addFunc({ breakpoint: ['desktop','tablet'], enter: function() { // Contact Box Exapnder $('.location-map-window:first').parents('.box'); $('.box').not('.active').find('.location-map-window1').hide(); $('.box').click(function(){ if (!$(this).hasClass('hide')) { $('.hide .location-map-window1').slideToggle().parents('.box').addClass('active'); $(".location-map-window1", this).slideToggle().parents('.box').removeClass('active'); }; }); }, exit: function() { } }); // Tablet Only jRes.addFunc({ breakpoint: ['tablet'], enter: function() { // Colorbox $('.gallery .slide a').colorbox({maxWidth:"750px"}); }, exit: function() { } }); // Tablet & Mobile jRes.addFunc({ breakpoint: ['tablet','mobile'], enter: function() { // Secondary Navigation Dropdown $("#secondary-nav h3 a").on('click', function($e) { $e.preventDefault(); $(this).toggleClass('active'); $(this).parent().next('ul').slideToggle('fast'); }); // Opens Address in Map Application on Mobile Only $('.mobileMap').each(function(){ href=$(this).attr('data-href'); $(this).replaceWith($('' + this.innerHTML + '')); }); }, exit: function() { } }); // Mobile only jRes.addFunc({ breakpoint: ['mobile'], enter: function() { }, exit: function() { } }); // animate to top - from Web Designer Wall /*$("#back-top").hide(); $(function (){ $(window).scroll(function (){ if($(this).scrollTop() > 100){ $('#back-top').fadeIn(); } else { $('#back-top').fadeOut(); } }); $('#back-top').click(function (){ $('body,html').animate({ scrollTop: 0 }, 800); return false; }); });*/ // Modal EAF Form /*$(".socialForm").click(function(){ $('#emailSocialButtonForm').modal(); });*/ // fauxlinks $('.fauxlink').click(function(){ href = $(this).find('a').attr('href'); if ($(this).find('a').attr('target') != '_blank'){ window.location.href = href; } else { window.open(href,'_blank'); } }); //FAQ Tabs $('.selectors > span').click(function(){ thisName = $(this).data('name'); if(thisName == "all"){ $('.panel-default').each(function(){ $(this).css('display','block'); }); } else { $('.panel-default').each(function(){ if($(this).hasClass(thisName)) { $(this).css("display", "block"); } else { $(this).css("display", "none"); } }); } }); }); // END document ready //primaryNav Hover Intent Configuration var primaryNavConfig = { sensitivity: 10, interval: 100, over: primaryOver, out: primaryOut, timeout: 250 }; function primaryOver(){$(this).find(">ul").slideDown('fast'); $(this).addClass("hover");} function primaryOut(){$(this).find(">ul").hide('fast'); $(this).removeClass("hover");}