2016-06-24 22:55:33 +02:00
|
|
|
// Agency Theme JavaScript
|
|
|
|
|
2016-06-22 21:35:40 +02:00
|
|
|
(function($) {
|
|
|
|
"use strict"; // Start of use strict
|
|
|
|
|
|
|
|
// jQuery for page scrolling feature - requires jQuery Easing plugin
|
2017-03-15 17:23:51 +01:00
|
|
|
$(document).on('click', 'a.page-scroll', function(event) {
|
2014-08-13 03:01:38 +02:00
|
|
|
var $anchor = $(this);
|
|
|
|
$('html, body').stop().animate({
|
2016-11-30 03:03:56 +01:00
|
|
|
scrollTop: ($($anchor.attr('href')).offset().top - 54)
|
2016-06-22 21:35:40 +02:00
|
|
|
}, 1250, 'easeInOutExpo');
|
2014-08-13 03:01:38 +02:00
|
|
|
event.preventDefault();
|
|
|
|
});
|
|
|
|
|
2016-06-22 21:35:40 +02:00
|
|
|
// Highlight the top nav as scrolling occurs
|
|
|
|
$('body').scrollspy({
|
2016-11-30 03:03:56 +01:00
|
|
|
target: '#mainNav',
|
2017-01-21 02:24:00 +01:00
|
|
|
offset: 54
|
2016-06-22 21:35:40 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
// Closes the Responsive Menu on Menu Item Click
|
2017-03-06 17:21:55 +01:00
|
|
|
$('.navbar-collapse>ul>li>a').click(function() {
|
|
|
|
$('.navbar-collapse').collapse('hide');
|
2016-06-22 21:35:40 +02:00
|
|
|
});
|
|
|
|
|
2016-11-30 03:03:56 +01:00
|
|
|
// jQuery to collapse the navbar on scroll
|
|
|
|
$(window).scroll(function() {
|
|
|
|
if ($("#mainNav").offset().top > 100) {
|
|
|
|
$("#mainNav").addClass("navbar-shrink");
|
|
|
|
} else {
|
|
|
|
$("#mainNav").removeClass("navbar-shrink");
|
2016-06-22 21:35:40 +02:00
|
|
|
}
|
2016-11-30 03:03:56 +01:00
|
|
|
});
|
2014-08-13 03:01:38 +02:00
|
|
|
|
2016-06-22 21:35:40 +02:00
|
|
|
})(jQuery); // End of use strict
|