Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1142469
    kirk74
    Participant

    Hi there, scroll to top anchor works perfectly, except on homepage, it is going to the slider and I need it to go the the masthead underneath slider.

    I tried both of the methods suggested here, and unfortunately neither quote worked: https://community.theme.co/forums/topic/scroll-top-anchor-to-masthead-under-slider/

    Of the 2 methods, the one that I still have set, is the javascript method. (not the extra .php file in the child theme folder), and if you try it out, you will notice that strangely, the first time you click the top anchor button on the homepage it works.. but then if you scroll down again and use it a second time, it goes to the very top .. it is like it is getting confused exactly where #top is, after the first click.

    Thanks for your help, I have tried to nut this out on my own but it is not seeming to make sense.

    #1142507
    kirk74
    Participant

    UPDATE – I have tested further, and the anomaly of it working the first time but then not after that actually happens with either of the 2 suggested methods.

    So I think that all is needed is somehow to make it clear that #top is the masthead not the slider.

    Thx. Will paste login privately.

    #1142516
    kirk74
    Participant
    This reply has been marked as private.
    #1142876
    Paul R
    Moderator

    Hi Kirk,

    I replaced the js code that reads

    
    jQuery(document).ready(function($) {
      $('.x-scroll-top').on('click', function(e) {
    
        e.preventDefault();
        $( this).unbind( "click" );
        $('html, body').stop();
        $('html, body').animate({
          scrollTop: $('.x-slider-container.above').outerHeight() + 1
        }, 850, 'easeInOutExpo');
    
        $(window).trigger('scroll');
    
      });
    });
    

    with this

    
    jQuery(document).ready(function($) {
      $('.home .x-scroll-top').off('click touchstart touchend');
      $('.home .x-scroll-top').on('click', function() {   
        $('html, body').animate({
          scrollTop: $('.x-slider-container.above').outerHeight() + 1
        }, 850, 'easeInOutExpo');                                                          
        return false; 
      });
    });
    

    It seems to work on my end. Please check.

    Thanks

    #1144001
    kirk74
    Participant

    yes! Perfect, thanks SO much 🙂

    #1144138
    Prasant Rai
    Moderator

    You are most welcome. 🙂

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