digitalcraftsman / hugo-agency-theme

Port of Startbootstrap's Agency theme to Hugo
http://themes.gohugo.io/theme/agency/
Apache License 2.0
160 stars 137 forks source link

[Question] Disable scroll on clicking menu #80

Closed LeeU1911 closed 7 years ago

LeeU1911 commented 7 years ago

Hello,

Thanks for your great work. I wonder if there's configuration to disable scrolling on clicking menu just like the demo site?

Thanks, Tom

binayak-banerjee commented 7 years ago

Seconded! I have the same question.

Thanks,

Ben

stp-ip commented 7 years ago

Not really, but you can overwrite the agency.js file and either remove this function:

// Smooth scrolling via animate()
$(document).ready(function(){
  if ($("body").attr("home")) {
    $(".anchor").on('click', function(event) {
      if (this.hash) {
        event.preventDefault();
        var hash = this.hash;
        $('html, body').animate({
          scrollTop: $(hash).offset().top
        }, 800, function(){
          window.location.hash = hash;
        });
      }
    });
  }
});