(function(){ "use strict"; // Preloader $(window).load(function() { $('#status').fadeOut(); $('#preloader').delay(550).fadeOut('slow'); $('body').delay(550).css({'overflow':'visible'}); }) $(document).ready(function($) { //Prevent empty links scroll to top default functionality /* */ //Alerts $('.close').on('click', function(){ $(this).parent().fadeOut(); }); // Hide Horizontal Scroll $('html').css('overflow-x', 'hidden'); // Smooth Scroll to Section $(function() { $('a[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 - 90 }, 800); return false; } } }); }); //Mobile Nav $('.mobile-nav ul').hide(); $('.show-menu').show(); $('.show-menu').on('click', function(){ $('.mobile-nav ul.mobile-nav-menu').toggle(); }); $('.mobile-nav-menu li a').on('click', function(){ $('.mobile-nav ul.mobile-nav-menu').toggle(); }); $('ul.mobile-nav-menu div').on('click', function(){ $('.mobile-nav ul li ul li ul').toggle(); $(this).next('ul li ul').toggle(); }); // Countdown $('[data-countdown]').each(function() { var $this = $(this), finalDate = $(this).data('countdown'); $this.countdown(finalDate, function(event) { $this.html(event.strftime( '

%w

Weeks

%D

Days

%H

Hours

%M

Minutes

%S

Seconds
' )); }); }); // Countdown Mobile $('[data-countdown-mobile]').each(function() { var $this = $(this), finalDate = $(this).data('countdown-mobile'); $this.countdown(finalDate, function(event) { $this.html(event.strftime( '

%D

Days

%H

Hours

%M

Minutes
' )); }); }); // Google Map function initialize() { var myLatlng = new google.maps.LatLng(41.884088, -74.579605); var mapOptions = { zoom: 14, scrollwheel: false, draggable: true, center: myLatlng, mapTypeId: 'satellite', disableDefaultUI: false } var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var contentString = '
'+ '

Brenner Mountain

'+ 'Open Map in New Window'+ '
'; var infowindow = new google.maps.InfoWindow({ content: contentString, }); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: 'Brenner Mountain!', InfoWindow: infowindow, }); marker.addListener('click', function() { infowindow.open(map, marker); }); infowindow.open(map, marker); } google.maps.event.addDomListener(window, 'load', initialize); // songrequests Form jQuery('#songrequests-form').ajaxForm(function(data) { if (data==1){ $('#success').fadeIn("slow"); $('#emailerr').fadeOut("slow"); $('#servererr').fadeOut("slow"); $('#songrequests-form').resetForm(); } else if (data==2){ $('#servererr').fadeIn("slow"); } else if (data==3) { $('#emailerr').fadeIn("slow"); } }); // Image Gallery var owl = $("#owl-gallery"); owl.owlCarousel({ itemsCustom : [ [0, 2], [400, 3], [600, 4], [800, 5], [1000, 6], [1600, 8] ], navigation : false, autoPlay : true, pagination : true }); // Image Gallery var owl2 = $("#owl-gallery2"); owl2.owlCarousel({ itemsCustom : [ [0, 2], [400, 3], [600, 4], [800, 5], [1000, 6], [1600, 8] ], navigation : false, autoPlay : true, pagination : true }); // Scroll Reveal // The starting defaults. var config = { after: '0s', enter: 'top', move: '60px', over: '0.66s', duration: 1200, scale: 0.4, easing: 'ease-in-out', viewportFactor: 0.33, reset: true, init: true }; window.sr = new ScrollReveal( config ); sr.reveal('h1'); sr.reveal('.names'); sr.reveal('.wedate'); sr.reveal('.main-images'); sr.reveal('.countdown'); sr.reveal('.countdown-mobile'); sr.reveal('#our-story .center-container'); sr.reveal('#our-story .gallery'); sr.reveal('#our-story h2'); sr.reveal('#our-story p'); sr.reveal('#ceremony h2'); sr.reveal('#ceremony p'); sr.reveal('#ceremony .ceremony-images'); sr.reveal('#celebration h2'); sr.reveal('#celebration p'); sr.reveal('#celebration .celebration-images'); sr.reveal('#location h2'); sr.reveal('#location p'); sr.reveal('#map-canvas', {scale: 1}); sr.reveal('#accommodation h2'); sr.reveal('#accommodation h3'); sr.reveal('#accommodation p'); sr.reveal('#accommodation .accomodation-images'); sr.reveal('#breakfast h2'); sr.reveal('#breakfast p'); sr.reveal('#faq h3'); sr.reveal('#faq p'); sr.reveal('#faq .faq-images'); sr.reveal('#faq .center-container'); sr.reveal('#gifts h2'); sr.reveal('#gifts p'); sr.reveal('#gifts .copyright'); sr.reveal('#gifts .center-container'); /* sr.reveal('#songrequests h2'); sr.reveal('#songrequests p'); sr.reveal('#songrequests-form'); */ sr.reveal('#photos .gallery'); sr.reveal('footer'); }); })();