WouterVanherck / portfolio

An Angular app for the ITalent portfolio
MIT License
0 stars 1 forks source link

Smooth scrolling not working properly #1

Open WouterVanherck opened 7 years ago

WouterVanherck commented 7 years ago

Smooth scrolling using jQuery easing is not working properly. Therefore the function in js/creative-agency.js should be checked.

$('a.js-scroll-trigger[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 - 48)
        }, 1000, "easeInOutExpo");
        return false;
      }
    }
  });
WouterVanherck commented 6 years ago

Update: JavaScript code seems to be working so the problem should be in the reference.