Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1047241
    crawfordandjohn
    Participant

    Hi, we’re trying to make some jquery animation work for some hash location links in some of our pages, but copying this code below hasn’t worked for us:

    jQuery(document).ready(function(){
      jQuery('a[href^="#"]').on('click',function (e) {
          e.preventDefault();
    
          var target = this.hash;
          $target = jQuery(target);
    
          jQuery('html, body').stop().animate({
              'scrollTop': $target.offset().top-80
          }, 900, 'swing');
      });
    });

    From: https://community.theme.co/forums/topic/smooth-scrolling-with-non-menu-anchor-links/

    Are you able to provide us with the correct code to add into the customiser please :)?

    Thanks!

    #1047242
    crawfordandjohn
    Participant
    This reply has been marked as private.
    #1047503
    Jade
    Moderator

    Hi there,

    Please try to setup the link on this page as a One Page Navigation.

    Then install and enable the Smooth Scroll extension from the Addons page.

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1047241 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>