Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. $('document').ready(function(){
  2. (function ($) {
  3. "use strict"; // Start of use strict
  4. // Smooth scrolling using jQuery easing
  5. $('a.js-scroll-trigger[href*="#"]:not([href="#"])').click(function () {
  6. if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
  7. var target = $(this.hash);
  8. target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
  9. if (target.length) {
  10. $('html, body').animate({
  11. scrollTop: (target.offset().top)
  12. }, 1000, "easeInOutExpo");
  13.  
  14. return false;
  15. }
  16. }
  17. });
  18.  
  19. // Closes responsive menu when a scroll trigger link is clicked
  20. $('.js-scroll-trigger').click(function () {
  21. $('.navbar-collapse').collapse('hide');
  22. });
  23.  
  24. // Activate scrollspy to add active class to navbar items on scroll
  25. $('body').scrollspy({
  26. target: '#sideNav'
  27. });
  28.  
  29. })(jQuery); // End of use strict
  30. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement