main.js (2568B)
1 jQuery(function($) {'use strict'; 2 3 //Responsive Nav 4 $('li.dropdown').find('.fa-angle-down').each(function(){ 5 $(this).on('click', function(){ 6 if( $(window).width() < 768 ) { 7 $(this).parent().next().slideToggle(); 8 } 9 return false; 10 }); 11 }); 12 13 //Fit Vids 14 if( $('#video-container').length ) { 15 $("#video-container").fitVids(); 16 } 17 18 //Initiat WOW JS 19 new WOW().init(); 20 21 // portfolio filter 22 $(window).load(function(){ 23 24 $('.main-slider').addClass('animate-in'); 25 $('.preloader').remove(); 26 //End Preloader 27 28 if( $('.masonery_area').length ) { 29 $('.masonery_area').masonry();//Masonry 30 } 31 32 var $portfolio_selectors = $('.portfolio-filter >li>a'); 33 34 if($portfolio_selectors.length) { 35 36 var $portfolio = $('.portfolio-items'); 37 $portfolio.isotope({ 38 itemSelector : '.portfolio-item', 39 layoutMode : 'fitRows' 40 }); 41 42 $portfolio_selectors.on('click', function(){ 43 $portfolio_selectors.removeClass('active'); 44 $(this).addClass('active'); 45 var selector = $(this).attr('data-filter'); 46 $portfolio.isotope({ filter: selector }); 47 return false; 48 }); 49 } 50 51 }); 52 53 54 $('.timer').each(count); 55 function count(options) { 56 var $this = $(this); 57 options = $.extend({}, options || {}, $this.data('countToOptions') || {}); 58 $this.countTo(options); 59 } 60 61 // Search 62 $('.fa-search').on('click', function() { 63 $('.field-toggle').fadeToggle(200); 64 }); 65 66 // Contact form 67 var form = $('#main-contact-form'); 68 form.submit(function(event){ 69 event.preventDefault(); 70 var form_status = $('<div class="form_status"></div>'); 71 $.ajax({ 72 url: $(this).attr('action'), 73 beforeSend: function(){ 74 form.prepend( form_status.html('<p><i class="fa fa-spinner fa-spin"></i> Email is sending...</p>').fadeIn() ); 75 } 76 }).done(function(data){ 77 form_status.html('<p class="text-success">Thank you for contact us. As early as possible we will contact you</p>').delay(3000).fadeOut(); 78 }); 79 }); 80 81 // Progress Bar 82 $.each($('div.progress-bar'),function(){ 83 $(this).css('width', $(this).attr('data-transition')+'%'); 84 }); 85 86 if( $('#gmap').length ) { 87 var map; 88 89 map = new GMaps({ 90 el: '#gmap', 91 lat: 43.04446, 92 lng: -76.130791, 93 scrollwheel:false, 94 zoom: 16, 95 zoomControl : false, 96 panControl : false, 97 streetViewControl : false, 98 mapTypeControl: false, 99 overviewMapControl: false, 100 clickable: false 101 }); 102 103 map.addMarker({ 104 lat: 43.04446, 105 lng: -76.130791, 106 animation: google.maps.Animation.DROP, 107 verticalAlign: 'bottom', 108 horizontalAlign: 'center', 109 backgroundColor: '#3e8bff', 110 }); 111 } 112 113 });