1 | // Floating label headings for the contact form |
---|
2 | $(function() { |
---|
3 | $("body").on("input propertychange", ".floating-label-form-group", function(e) { |
---|
4 | $(this).toggleClass("floating-label-form-group-with-value", !!$(e.target).val()); |
---|
5 | }).on("focus", ".floating-label-form-group", function() { |
---|
6 | $(this).addClass("floating-label-form-group-with-focus"); |
---|
7 | }).on("blur", ".floating-label-form-group", function() { |
---|
8 | $(this).removeClass("floating-label-form-group-with-focus"); |
---|
9 | }); |
---|
10 | }); |
---|
11 | |
---|
12 | // Navigation Scripts to Show Header on Scroll-Up |
---|
13 | jQuery(document).ready(function($) { |
---|
14 | var MQL = 1170; |
---|
15 | |
---|
16 | //primary navigation slide-in effect |
---|
17 | if ($(window).width() > MQL) { |
---|
18 | var headerHeight = $('.navbar-custom').height(); |
---|
19 | $(window).on('scroll', { |
---|
20 | previousTop: 0 |
---|
21 | }, |
---|
22 | function() { |
---|
23 | var currentTop = $(window).scrollTop(); |
---|
24 | //check if user is scrolling up |
---|
25 | if (currentTop < this.previousTop) { |
---|
26 | //if scrolling up... |
---|
27 | if (currentTop > 0 && $('.navbar-custom').hasClass('is-fixed')) { |
---|
28 | $('.navbar-custom').addClass('is-visible'); |
---|
29 | } else { |
---|
30 | $('.navbar-custom').removeClass('is-visible is-fixed'); |
---|
31 | } |
---|
32 | } else if (currentTop > this.previousTop) { |
---|
33 | //if scrolling down... |
---|
34 | $('.navbar-custom').removeClass('is-visible'); |
---|
35 | if (currentTop > headerHeight && !$('.navbar-custom').hasClass('is-fixed')) $('.navbar-custom').addClass('is-fixed'); |
---|
36 | } |
---|
37 | this.previousTop = currentTop; |
---|
38 | }); |
---|
39 | } |
---|
40 | }); |
---|