File size: 2,281 Bytes
597ee18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*!
 * Start Bootstrap - Freelancer Bootstrap Theme (http://startbootstrap.com)
 * Code licensed under the Apache License v2.0.
 * For details, see http://www.apache.org/licenses/LICENSE-2.0.
 */

lightbox.option({
  'albumLabel': '%1/%2'
});
// jQuery for page scrolling feature - requires jQuery Easing plugin
$(function() {
    $('.page-scroll a').bind('click', function(event) {
        var $anchor = $(this);
        $('html, body').stop().animate({
            scrollTop: $($anchor.attr('href')).offset().top
        }, 1500, 'easeInOutExpo');
        event.preventDefault();
    });

    // Initialize WOW.js Scrolling Animations
    new WOW().init();
});

// Floating label headings for the contact form
$(function() {
    $("body").on("input propertychange", ".floating-label-form-group", function(e) {
        $(this).toggleClass("floating-label-form-group-with-value", !! $(e.target).val());
    }).on("focus", ".floating-label-form-group", function() {
        $(this).addClass("floating-label-form-group-with-focus");
    }).on("blur", ".floating-label-form-group", function() {
        $(this).removeClass("floating-label-form-group-with-focus");
    }).on("click", ".cs-options li", function(){
        $(this).closest(".cs-select").addClass("done");
    });

    $('form').on('submit', function(e){
      e.preventDefault();
      if (this.checkValidity()) {
        $form   = $(this);
        $button = $form.find('button');
        $button.html('<i class="fa fa-spin fa-spinner"></i>');
        $.ajax({
          url: this.action,
          type: "POST",
          data: $(this).serialize(),
          dataType: "json"
        }).done(function (data) {
          $form.find('input:visible, textarea').val('');
          $('.cs-placeholder').each(function () {
            $(this).html($(this).next().next().find('option:first').html());
            $(this).closest(".cs-select").removeClass("done");
          });
          $button.html($button.data('sent-text')).addClass('sent');
        });
      }

    });
});

// Highlight the top nav as scrolling occurs
$('body').scrollspy({
    target: '.navbar-fixed-top'
})

// Closes the Responsive Menu on Menu Item Click
$('.navbar-collapse ul li a').click(function() {
    $('.navbar-toggle:visible').click();
});