Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1002017
    belayachimarouane
    Participant

    Hello,

    when I reload a page it comes back to the exact same position before reloading.
    I want the page to comeback at the top of the page on every reload. Is it possible ?

    Thank you!

    #1002280
    Jade
    Moderator

    Hi there,

    Please add this code in Appearance > Customize > Custom > JS:

    (function($){
        $(this).scrollTop(0);
    })(jQuery);

    Hope this helps.

    #1002968
    belayachimarouane
    Participant

    Hello! Unfortunately it doesn’t work!

    #1002991
    Rue Nel
    Moderator

    Hello There,

    I am another staff checking this thread! Please update the code and use this instead:

    (function($){
      $(document).ready(function{
        $('html, body').animate({
          scrollTop: 0
        }, 850, 'easeInOutExpo');
      });
    
      $(window).on('load', function(){
        $('html, body').animate({
          scrollTop: 0
        }, 850, 'easeInOutExpo');
      });
    })(jQuery);

    Please let us know if this works out for you.

    #1003831
    belayachimarouane
    Participant

    Hello;
    Still no success with it πŸ™

    #1003851
    Thai
    Moderator

    Hi There,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.

    #1011608
    belayachimarouane
    Participant
    This reply has been marked as private.
    #1011985
    Rue Nel
    Moderator

    Hello There,

    Thanks for providing the login credentials. I went ahead and updated the JS code. I used this instead:

    $(window).on('beforeunload', function() {
        $(window).scrollTop(0);
    });

    If you need anything else we can help you with, please let us know.

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