/* Display Mobile Menu */ $(document).ready(function(){ if($(window).width() <= 1020){ //only works on screensizes where mobile menu is present (in this case 1020px) $("#lower_bar_2").click(function(){ $("#pages-list").slideToggle(); }); } }); /* Add Class to Lower Bar on Mobile Navigation Click */ if($(window).width() <= 1020){ //only works on screensizes where mobile menu is present (in this case 1020px) $("#lower_bar_2").click(function(){ $(this).toggleClass("open"); }); } /* Display Menu Sub Nav */ $(document).ready(function(){ $("#pages-list > li:nth-child(3)").click(function(){ $("#pages-list > li:nth-child(3) > ul").toggle("fast"); }); }); /* Add Class to List Item on Click */ $("#pages-list > li:nth-child(3)").click(function(){ $(this).toggleClass("active"); }); /* Replace Span with Link in Navigation */ $(document).ready(function() { $('#pages-list > li:nth-child(1) > span').replaceWith('Home'); $('#pages-list > li:nth-child(2) > span').replaceWith('About'); $('#pages-list > li:nth-child(5) > span').replaceWith('Blog'); $('#pages-list > li:nth-child(6) > span').replaceWith('Contact'); }); /* Window Scroll Function */ $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll >= 1) { $("#lower_bar").addClass("light-nav"); } else { $("#lower_bar").removeClass("light-nav"); } if (scroll >= 1) { $("#siteHeader").addClass("small-logo"); } else { $("#siteHeader").removeClass("small-logo"); } }); /* Window Height to Equal Viewport Height */ var vHeight = $(window).height(), cover = $('#wizzy96'); cover.css({"height":vHeight}); /* Scroll to Page Anchor */ $(function(){ $('a[href*="#"]:not([href="#"])').click(function() { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top }, 1000); return false; } }); }); /* Scroll to Top Function */ $(document).ready(function(){ $(window).scroll(function(){ if ($(this).scrollTop() > 100) { $('.scrollup').fadeIn(); } else { $('.scrollup').fadeOut(); } }); $('.scrollup').click(function(){ $("html, body").animate({ scrollTop: 0 }, 600); return false; }); }); /* Add Floating Social Icons */ $('

     

').prependTo('#pagecontainer'); /* Add Current Date */ var months = ['January','February','March','April','May','June','July', 'August','September','October','November','December']; var tomorrow = new Date(); tomorrow.setTime(tomorrow.getTime() + (1000*3600*24)); document.getElementById("spandate").innerHTML = tomorrow.getFullYear(); /* Add Container Class to Contact Form */ $( "#form_93" ).addClass( "container" ); /* Enable Colorbox Video */ $(document).ready(function(){ $(".popup-video").colorbox({iframe:true, innerWidth:800, innerHeight:450}); }); /* Colorbox Responsive Sizing */ jQuery.colorbox.settings.maxWidth = '90%'; jQuery.colorbox.settings.maxHeight = '90%'; // ColorBox resize function var resizeTimer; function resizeColorBox() { if (resizeTimer) clearTimeout(resizeTimer); resizeTimer = setTimeout(function() { if (jQuery('#cboxOverlay').is(':visible')) { jQuery.colorbox.load(true); } }, 300); } // Resize ColorBox when resizing window or changing mobile device orientation /* jQuery(window).resize(resizeColorBox); */ window.addEventListener("orientationchange", resizeColorBox, false);