mirror of
https://github.com/odoo/design-themes.git
synced 2025-10-07 01:18:52 +07:00
[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:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user