Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #806921

    Hi,

    I experienced a problem with one of our customers sites that is a one-pager. We created a menu with anchor links to scroll to the specified sections.

    Works fine in Chrome and Safari, but doesn’t work in Firefox unfortunately.

    Here is what I tried already:
    – updating the theme to the current version (4.0.6)
    – We did some modifications on avia.js, that’s why it’s loaded from the child theme, though the part responsible for the scrolling is from the default and current version avia.js. I still tried it with the parent theme’s original avia.js –> didn’t work either.
    – deactivated all plugins –> didn’t work
    – console.log from the callback of the scrolling animation get’s output, but the animation itself doesn’t do anything

    Thanks for your help.

    Florian

    #807531

    Hey gugler,

    Here is a solution
    https://stackoverflow.com/questions/8149155/animate-scrolltop-not-working-in-firefox
    From the example snippet here, you can see, that you kind of have to delegate the scroll to html and body elements:

    
    $('.arrow-up').click(function(){
        $('html, body').animate({scrollTop : 0},300);
        return false;
    });
    

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #807889

    Hi Victoria,

    thanks for the quick answer, though I don’t really understand it. That’s the way Enfold does it anyway, isn’t it?

    From avia.js

    
    $('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function() {
        console.log('done with the animation')
        // add new hash to the browser location
        // window.location.href=newLocation;
        if(window.history.replaceState) {
            window.history.replaceState("", "", newHash);
        }
    });

    I am getting to the ‘done with the animation’ log in Firefox, so it does call the callback function. But it doesn’t scroll.

    Kind regards,
    Florian

    #808179

    Hi Florian,

    You’re right, totally missed it :)
    Can you try without the :not and the :animated parts, also do

    function(e) 

    and check for the event. And look at the target var in FF.

    Best regards,
    Victoria

    #809678

    Hi Victoria,

    I tried it without :not and :animated and checked the event. It is undefined in Chrome and in FF. The target variable is defined and correct.

    Kind regards,
    Florian

    #809682

    … and it get’s weirder and weirder. I tried deactivating all plugins + removing all the custom js files from my child theme. So it’s now the plain page with all the js loaded from the parent theme and without any plugins. The problem still occurs in Firefox.

    I don’t have any ideas left.

    Kind regards,
    Florian

    #810286

    Hi Florian,

    Here is what you could try:
    https://coderwall.com/p/b-zq7g/bugfix-jquery-animate-scrolling-for-firefox
    https://stackoverflow.com/questions/37591372/jquery-animate-scrolltop-issue-in-firefox

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #812974

    Hi Victoria,

    I tried both of the suggested fixes:
    $('**html,body**').animate({ scrollTop: target }, duration, easing);
    and
    $('window').animate({ scrollTop: target }, duration, easing);

    None of them work in Firefox.

    Kind regards,
    Florian

    #813379

    Hi Florian,

    Have you tried it like this, without animation?

    
    $('html,body').animate({ scrollTop: target }, duration);

    Best regards,
    Victoria

    #818602

    Hi Victoria,

    yes I did, without any luck.

    Kind regards,
    Florian

    #819036

    Hi,

    Unfortunately it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However if its really important for you to get this done, you can always hire a freelancer to do the job for you :)

    Best regards,
    Basilis

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.