-
AuthorPosts
-
June 12, 2017 at 3:34 pm #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 anythingThanks for your help.
Florian
June 13, 2017 at 3:45 pm #807531Hey 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,
VictoriaJune 14, 2017 at 10:21 am #807889Hi 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,
FlorianJune 14, 2017 at 7:55 pm #808179Hi Florian,
You’re right, totally missed it :)
Can you try without the :not and the :animated parts, also dofunction(e)
and check for the event. And look at the target var in FF.
Best regards,
VictoriaJune 19, 2017 at 8:52 am #809678Hi 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,
FlorianJune 19, 2017 at 9:20 am #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,
FlorianJune 20, 2017 at 10:36 am #810286Hi 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-firefoxIf you need further assistance please let us know.
Best regards,
VictoriaJune 26, 2017 at 11:19 am #812974Hi 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,
FlorianJune 27, 2017 at 12:50 pm #813379Hi Florian,
Have you tried it like this, without animation?
$('html,body').animate({ scrollTop: target }, duration);
Best regards,
VictoriaJuly 10, 2017 at 8:59 am #818602Hi Victoria,
yes I did, without any luck.
Kind regards,
FlorianJuly 10, 2017 at 11:33 pm #819036Hi,
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 -
AuthorPosts
- You must be logged in to reply to this topic.