[FIX] website_animate: fix start of animations

Before this commit, the calculation of the top position of the
animated elements did not take into account the fact that the
scrollable element is no longer the body. And therefore the animations
never started.

task-2215118

closes odoo/design-themes#54

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
Benjamin Vray
2021-07-27 08:01:34 +00:00
parent 695389adcd
commit d3a05c4ef5
@@ -55,7 +55,7 @@ var WebsiteAnimate = {
// We need to offset for the change in position from some animation
// So we get the top value by not taking CSS transforms into calculations
var elTop = self.getElementOffsetTop($el[0]);
var elTop = self.getElementOffsetTop($el[0]) - $().getScrollingElement().scrollTop();
var visible = windowBottom > (elTop + elOffset) && windowTop < (elTop + elHeight - elOffset);