Issue with Custom Code for Smooth Scroll

Hello Readymag Community,

I’ve been trying to implement a smooth scrolling effect (with Customized speed) on my website using custom code.
However, despite placing the code correctly as per recommendations, I’m not getting the desired effect. I’m hoping someone here might have faced a similar challenge and can offer some guidance.

Here’s a breakdown of the custom codes I’ve added:

  1. In the Head section:
<script src=""></script>
  1. Before the </body> tag:
$(document).on('click', 'a[href^="#"]', function(e) {

    var target = this.hash;
    var $target = $(target);

    $('html, body').stop().animate({
        'scrollTop': $target.offset().top
    }, 2000, 'swing', function() {
        window.location.hash = target;

Has anyone experienced a similar issue or can spot something I might be missing? Your insights and suggestions would be greatly appreciated.

Thank you in advance for your help!

Best regards,

Gryun Kim

hey. regarding your page order different container-divs are scrolled. So it might not be
$(‘html, body’).
Look into the inspector to get find out whats the container that gets scrolled.