Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1109557

    Rad
    Moderator

    Hi there,

    Ah, looks like working, just need to change this

    function x_scroll_to($, scroll_to) {
         if( scroll_to.length > 0 ) $('html,body').animate({scrollTop: $(scroll_to).offset().top - $('header.masthead').height() },700 ,'swing');
    }

    to this

    function x_scroll_to($, scroll_to) {
         if( scroll_to.length > 0 ) $('html,body').stop().animate({scrollTop: $(scroll_to).offset().top - $('header.masthead').height() },700 ,'swing');
    }

    Your page has multiple scroll animation. Added stop() to halt other animations.

    Please try that and let me know 🙂

    The whole footer wraps within the link because of not properly closed <p> and <a>. Glad it’s fixed now.

    Thanks!

    #1109570

    TheLunchBawx
    Participant

    Tried that and it still seems to jump to the section and then scrolls down really fast.

    Thanks!

    #1109823

    Rad
    Moderator

    Hi there,

    It’s not jumping on my end, and it’s normal for it to scroll fast when the target position is too far.

    Also, the scroll happens while the page is loading, it’s different from clicking a button then scroll. Hence, it will scroll while it loads.

    You can try this one,

    jQuery(function($){
      
    $('html,body').stop().scrollTop(0);
    
      $(document).ready(function() {
         
         var hash = location.href.split("#").slice(-1)[0];
         var outbound = /^https?:\/\//i;
    
         if( hash && !outbound.test( hash ) ) x_scroll_to($, $('#' + hash ) );
    
      });
    
      $('.scroll_to').click(function(e){
        e.preventDefault();
        x_scroll_to($, $('#' + $(this).attr('href').split("#").slice(-1)[0] ));
      });
    
    });
    
    function x_scroll_to($, scroll_to) {
         if( scroll_to.length > 0 ) $('html,body').stop().animate({scrollTop: $(scroll_to).offset().top - $('header.masthead').height() },700 ,'swing');
    }    

    This line $('html,body').stop().scrollTop(0); force it to originate on top then scroll.

    Thanks!

    #1109855

    TheLunchBawx
    Participant

    Alright thanks. Not sure why it still jumps to the section, goes back to the top and then scrolls down for me.

    But I guess if it doesn’t do that for you then it’s fine. I just would like to see it work.

    I don’t actually mind that it scrolls while the page is loading. My issue is the glitchy effect where it jumps then scrolls.

    #1109871

    Rad
    Moderator

    Hi there,

    Yes, looks okay from my end. Though yes, sometimes it jumps a little depending on loading speed on my end.

    Thanks!