Go to Top Button not working

Hi, yes but that does not solve the problem, i have a goto top button but it takes me to the top of the page, i dont want that i want it to take me to the top of the menu.

Hi there,

The initial subject of this thread has been solved as it was about the scroll to top button not working because of your custom script.

As for the scroll to top button, that is its default behavior where the page scrolls to the top when you click it thus the name scroll to top. You will have to write some custom code to override the default setting that is native to the theme. This is something we cannot provide because this falls beyond the scope of our support.

Thank you.

What do you mean it is beyong the scope of your support?
your support gave me that code in the thread i linked
why are you telling me that something you did helped me with now you cant help me with.

You supported me in this thread https://theme.co/apex/forum/t/go-to-top-button/21398/2
how come now its outside of your support scope?
the code is became outdated because of the X theme update. so now its outside of your support scope?

Hi there,

I understand that you have emailed in directly. Matt will respond to your email within 24 hours.

Thank you.

Hello there,

The email has nothing to do with this thread, if you cant help me at least forward this thread to lely, she assisted me with this code on my last thread i have linked. she is probably the one who can know what went wrong with the code since X last update, thanks.

Hi there,

We are sorry about not communicating with you properly in the first place. That is a problem by our part and now I will try to explain the case in details.

Your request was a customization and our support staff went above and beyond to implement the feature for you, but they forgot to state that it is outside of our support policy which we already stated in our terms of service:

https://theme.co/apex/terms/

W should have mention that the customization we provide is a mean to be extra helpful and if the code breaks for any reason including the update of the theme we will not be able to follow up and the burden will be on your shoulders.

I am stating the same thing now for all and the future customization that you ask from us. If you ask for a feature which is not presented out of the box we will assess the case and if it is feasible we will give you the suggestions to implement the feature but the same rules that I already mentioned will apply.

Having said that, I will ask Lely to check the case and if it is possible give you a follow up. Please consider that there is no guarantee that we can accommodate the code suggested with the new version of the theme.

Thank you for your understanding.

1 Like

Hi There,

We’re sorry for the inconvenience this has cause you but yes, Christopher is correct. We tried are best to help but going forward, the responsibility to maintain the code is not part of the support. I tried to check though why it is not working anymore but then I cannot access login URL. .wp-login.php or wp-admin is not working or accessible.

1 Like

Hey cris, hey lely,
thank you for your reply! i understand the following, but i am asking for the help of you please, i am not sure it is because of the theme update, i think its because some ID or # has been changed,
adding secure note

Hi there,

I don’t think this is related to update. I implemented the same code and the error is because the jQuery is not defined. Probably a conflict with other codes, jQuery is Wordpress built-in library so it should be loading okay.

Since its live and in a different language, I prefer not to troubleshoot and further remove any custom code. The code doesn’t need fixing or any changes since it still uses the same selector (class). What you need is disable all plugins (except cornerstone) and test the same code on your site.

Thanks!

i have tried everything, i removed all plugins and still the code doesnt work

Hey There,

The Scroll to Top button is not working because there is a JS error on the page. Please have the JS code updated in the theme options custom JS section and use this:

jQuery(function($) {
    $('.scrol-top-advanced a').on('click', function(event) {
        event.preventDefault();
        setTimeout(function() {
            $('.scrol-top-advanced a').css('display', 'none');
        }, 1000);
    });
});

jQuery('.cp-default-close').on('click', function() {
    jQuery('video')[0].pause();
});

jQuery('.wp-side-menu a.wp-side-menu-item').attr('target', '_blank');

jQuery(function($) {
    $(document).on('click', '.cp-overlay-close', function() {
        $('.rev_slider video').each(function() {
            $(this).get(0).pause();
        });
    });
});

(function($){
  $(document).scroll(function() {
    var y = $(this).scrollTop();
    if (y > 665) {
      $('.wp-side-menu').fadeIn();
    } else {
      $('.wp-side-menu').fadeOut();
    }
  });
})(jQuery);






//=================================== SMOOTH SCROLLING EXTERNAL ANCHOR //      
(function($){
  $(document).on("ready", function () {
      var urlHash = window.location.href.split("#")[1];
      $('html,body').animate({
          scrollTop: $('.' + urlHash + ', #' + urlHash +',[name='+urlHash+']').first().offset().top -100
      }, 1000);
  });
 
})(jQuery);
 
 
// =================================== SMOOTH SCROLLING LOCAL ANCHOR //
(function($) {
        $('a[href*=#]:not([href=#])').click(function() {
            if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
              var target = $(this.hash);
              target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
              if (target.length) {
                $('html,body').animate({
                  scrollTop: target.offset().top -100
                }, 1000);
                return false;
              }
            }
        });
})(jQuery);

// =================================== SMOOTH SCROLLING LOCAL ANCHOR 

(function($){
  $(document).ready(function() { 
      var elem = $('#_' + window.location.hash.replace('#', ''));
      if(elem) {
           $.scrollTo(elem.left, elem.top);
      }
  });
})(jQuery);

Please let us know how it goes.

1 Like

Hey RueNel!

I have replaced the code, however it doesnt fixes the scroll top button but it did vanish the side menues on the open screen and shows them only after scrolling down which is actualy what i wanted as well, is there any option to vanish the chat popup and the accesibility and the online counter as well!?!?
Screenshot>> http://prntscr.com/j9a21n

update: the side menues are not shown in other pages it seems they only shown after scrolling down. can this be fixed?

Please feel free to enter website with credentials as admin and edit it (the codes) as you wish, i trust you.

Hi there,

You already added another thread regarding the go to top button and we followed up the case there. I will add the answer here again:

Hi there,

Unfortunately that is not possible with the custom code you have. You need to use our default Go to Top feature which you can enable from X > Theme Options > Miscellaneous > SCROLL TOP ANCHOR.

Our theme does not have an option to stop the go to top animation in a specific section of the page and it will go all the way to the top.

If you need such a feature you will need to hire a developer to do that for you.

Thank you for your understanding.

Thank you.

how could you tell me to hire a developer to do that for me ? i have paid 50$ for developers here to help me and that what you tell me?

Hey There,

I am another staff checking this thread. Is your Go to top button still not working? I have check your site and I found out two things:

  1. The “go to top” is coming a from 3rd party plugin “Scroll Top Advanced”. I would highly recommend that you contact the creators of this plugin. They should be able to help you how to properly set up this plugin and work with the theme.
  2. There are so many custom JS in the page. It could be cause by a JS conflict. I would highly recommend that you temporarily remove them and place it back one after the the other to find out which of which is causing the issue.

Please let us know how it goes.

1 Like

Hey RueNel,
i was hoping you would respond since you were giving me the code and i need to speak about this issue with you,
please refe to this answer:

  1. i have removed the 3rd plugin “Scroll Top Advanced” and now i am using the X-Theme scoll top option.
  2. The Custom JS is the JS you gave me in this thread https://theme.co/apex/forum/t/go-to-top-button-not-working/29471/19

Hello There,

Thanks for writing in! I have made some necessary changes to the scroll to top button and it is working correctly now. When you click on it, it goes to the navbar and not on top of the page.

Please check your site now.

1 Like

Oh great! Thanks!
Can you please tell me what are the changes that you made so i will remember for next time? please

Hello There,

It’s good to know that it is now working for you.

The changes I made is in your child theme’s functions.php file. I have change the value of the position of the top anchor when there is a slider above the masthead present on the page. I used this code:


// Custom Scroll Top Anchor
// =============================================================================

if ( ! function_exists( 'x_scroll_top_anchor' ) ) :
  function x_scroll_top_anchor() {

    if ( x_get_option( 'x_footer_scroll_top_display' ) == '1' ) : ?>

      <a class="x-scroll-top <?php echo x_get_option( 'x_footer_scroll_top_position' ); ?> fade" title="<?php esc_attr_e( 'Back to Top', '__x__' ); ?>">
        <i class="x-icon-angle-up" data-x-icon="&#xf106;"></i>
      </a>

      <script>

      jQuery(document).ready(function($) {

        var windowObj            = $(window);
        var body                 = $('body');
        var bodyOffsetBottom     = windowObj.scrollBottom();             // 1
        var bodyHeightAdjustment = body.height() - bodyOffsetBottom;     // 2
        var bodyHeightAdjusted   = body.height() - bodyHeightAdjustment; // 3
        var scrollTopAnchor      = $('.x-scroll-top');

        function sizingUpdate(){
          var bodyOffsetTop = windowObj.scrollTop();
          if ( bodyOffsetTop > ( bodyHeightAdjusted * <?php echo x_get_option( 'x_footer_scroll_top_display_unit' ) / 100; ?> ) ) {
            scrollTopAnchor.addClass('in');
          } else {
            scrollTopAnchor.removeClass('in');
          }
        }

        windowObj.bind('scroll', sizingUpdate).resize(sizingUpdate);
        sizingUpdate();

        scrollTopAnchor.click(function(){
          var vtop = 0;
          if ( $('.x-slider-container').length > 0 ) {
            vtop = $('.x-slider-container').height();
          } 

          $('html, body').animate({ scrollTop: vtop }, 850, 'xEaseInOutExpo');
          return false;
        });

      });

      </script>

    <?php endif;

  }
  add_action( 'x_after_site_end', 'x_scroll_top_anchor' );
endif;

Hope this explains it.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.