(function($) { "use strict"; $('a.smooth-scrolling-js[href*="#"]:not([href="#"])').click(function() { if ( location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") && location.hostname == this.hostname ) { var target = $(this.hash); target = target.length ? target : $("[name=" + this.hash.slice(1) + "]"); if (target.length) { $("html, body").animate({ scrollTop: target.offset().top }, 1000, "easeInOutExpo" ); return false; } } }); $(".smooth-scrolling-js").click(function() { $(".navbar-collapse").collapse("hide"); }); $("body").scrollspy({ target: "#sideNav", }); $(document).ready(function() { var current_path = window.location.pathname; console.log(current_path); $('.sub_view_menu ul li a[href="' + current_path + '"]').addClass('active'); }); })(jQuery);