[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#58

X-original-commit: d3a05c4ef5
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 743de8db40
commit 6f0f8e22ab
@@ -55,7 +55,7 @@ var WebsiteAnimate = {
// We need to offset for the change in position from some animation // 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 // 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); var visible = windowBottom > (elTop + elOffset) && windowTop < (elTop + elHeight - elOffset);