You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.0 KiB
35 lines
1.0 KiB
// Agency Theme JavaScript |
|
|
|
(function($) { |
|
"use strict"; // Start of use strict |
|
|
|
// jQuery for page scrolling feature - requires jQuery Easing plugin |
|
$('a.page-scroll').bind('click', function(event) { |
|
var $anchor = $(this); |
|
$('html, body').stop().animate({ |
|
scrollTop: ($($anchor.attr('href')).offset().top - 54) |
|
}, 1250, 'easeInOutExpo'); |
|
event.preventDefault(); |
|
}); |
|
|
|
// Highlight the top nav as scrolling occurs |
|
$('body').scrollspy({ |
|
target: '#mainNav', |
|
offset: 55 |
|
}); |
|
|
|
// Closes the Responsive Menu on Menu Item Click |
|
$('#navbarResponsive>ul>li>a').click(function() { |
|
$('#navbarResponsive').collapse('hide'); |
|
}); |
|
|
|
// jQuery to collapse the navbar on scroll |
|
$(window).scroll(function() { |
|
if ($("#mainNav").offset().top > 100) { |
|
$("#mainNav").addClass("navbar-shrink"); |
|
} else { |
|
$("#mainNav").removeClass("navbar-shrink"); |
|
} |
|
}); |
|
|
|
})(jQuery); // End of use strict
|
|
|