Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1488326

    Hello dear helpers,

    I search to change the anchors and the redirections of all the scroll down links who are in the fullscreen sliders in my website (www.kerry-han.fr), can someone tell me if it’s possible ?

    Thanks, best regards.

    #1488370

    Hey Alexandre,
    Those “next section” arrows are built in and seem to be working correctly. Are finding that they don’t go enough or too far?
    Try this solution

    Best regards,
    Mike

    #1488371

    This helps me a lot but the offset works only on desktop and not on mobile and tablet, can you help me to make it work on it ?

    #1488464

    Hi,
    Thanks for your patience, I see that you are forcing a fixed header for mobile which is not a theme option, which is ok, but the problem is that the solution is written in PHP, so the avf_header_setting_filter is applied in PHP before the page is rendered, so it can’t directly detect the screen size. (PHP runs server-side, screen width is only known client-side in the browser).
    If the above solution worked for you then try also adding this to your functions.php file:

    add_action('wp_head', function () {
        ?>
        <style>
            :root { --scroll-offset: 48px; }
            @media (max-width: 767px) {
                :root { --scroll-offset: 80px; }
            }
            @media (min-width: 768px) and (max-width: 1023px) {
                :root { --scroll-offset: 64px; }
            }
        </style>
        <script>
            (function($){
                $(function(){
                    if (typeof avia_header_scroll_offset !== 'undefined') {
                        var offset = getComputedStyle(document.documentElement)
                                     .getPropertyValue('--scroll-offset');
                        avia_header_scroll_offset = parseInt(offset, 10);
                    }
                });
            })(jQuery);
        </script>
        <?php
    });
    

    If this doesn’t work then you should remove both and use javascript, let us know.

    Best regards,
    Mike

    #1488489

    Your first response work but not with phone and tablet and i try to modify the code to make the offset bigger and see a difference but it don’t works, what can i do ?

    #1488507

    Hi,
    Ok, please remove all of the code and we will try a javascript solution.
    An admin login may help us.

    Best regards,
    Mike

    #1488532

    Ok i send login in private content of this message. Thanks a lot.

    #1488561

    Hi,
    Thanks, but I get this error:
    Error: This password does not match the username.
    Please check.

    Best regards,
    Mike

    #1488563

    Retry now for me it works and if you search some menus in the toolbar you can show them on admin menu editor in the settings.

    #1488569

    Hi,
    Thanks I was able to login, but this is tricker than I thought, I will work on it some more and get back to you tomorrow.

    Best regards,
    Mike

    #1488736

    Hi,
    Thanks for your patience, I believe that it is sorted out now, clear your browser cache and check.
    This is the code that I added:

    function custom_offset_script_with_width() { ?>
        <script>
    (function($) {
      $('a[href*="#next-section"]').click(function() {
      	var width = $(window).width()
          	if ($(window).width() < 768) {
            $('html,body').animate({
              scrollTop: $(this).offset().top - 100 //offsets for mobile fixed header
            }, 1000);
            return false;
           } else if (width >= 768 && width <= 1366) {
            $('html,body').animate({
              scrollTop: $(this).offset().top - 75 //offsets for tablet fixed header
            }, 1000); 
            return false; 
          } else {
          	$('html,body').animate({
              scrollTop: $(this).offset().top - 50 //offsets for desktop fixed header
            }, 1000);
            return false;
          }
      });
    }(jQuery));
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_offset_script_with_width');

    Best regards,
    Mike

    #1488737

    Hello Mike,

    I just wanted to thank you for your help and your speed during our conversations !
    All works perfectly and that’s what i wanted to see on my website.
    But i hope you can help me more because i recently make the update of my website (6.0.2 to 7.1.2) and some little things changed and crashed on my website. I think i can solve some of those problems but i need help with the 2 timelines on my website here :
    http://www.kerry-han.fr
    and here
    http://www.kerry-han.fr/agenda
    In fact the timelines works on desktop but not really in phone and tablet. And for the others things, all the scroll down buttons on fullscreen sliders disapears and also scroll up button and also the arrows to change article and finally my search bar and search icon disapears also ! 😭
    So if you can help me mike or you know someone else on the support who can do this, text me here please i really need help !😅

    Best regards !

    #1488749

    Hi,
    Glad this helps, your icons are not showing because of this css you had in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:

    /*Modification de l'affichage de l'icône des cookies (cadenas)*/
    #top .avia-svg-icon.avia-font-svg_entypo-fontello svg:first-child {
        display: none !important;
    }

    I disabled it for you.
    As for your timeline question, please open a new thread as we ask that each thread sticks to one topic. Thanks for you understanding.

    Best regards,
    Mike

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Change anchors of scroll down link buttons’ is closed to new replies.