new-age.js (850B)
1 (function($) { 2 "use strict"; // Start of use strict 3 4 // jQuery for page scrolling feature - requires jQuery Easing plugin 5 $('a.page-scroll').bind('click', function(event) { 6 var $anchor = $(this); 7 $('html, body').stop().animate({ 8 scrollTop: ($($anchor.attr('href')).offset().top - 50) 9 }, 1250, 'easeInOutExpo'); 10 event.preventDefault(); 11 }); 12 13 // Highlight the top nav as scrolling occurs 14 $('body').scrollspy({ 15 target: '.navbar-fixed-top', 16 offset: 100 17 }); 18 19 // Closes the Responsive Menu on Menu Item Click 20 $('.navbar-collapse ul li a').click(function() { 21 $('.navbar-toggle:visible').click(); 22 }); 23 24 // Offset for Main Navigation 25 $('#mainNav').affix({ 26 offset: { 27 top: 50 28 } 29 }) 30 31 })(jQuery); // End of use strict