From cbec2f02177ed1872360ff2f5ec6fd45d70f2518 Mon Sep 17 00:00:00 2001 From: SalvoDiFede Date: Wed, 15 Apr 2015 22:44:42 +0200 Subject: [PATCH] Update isVisible Using box.getBoundingClientRect() for better compatibility, please check and test before commit to main branch :-) --- src/wow.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wow.coffee b/src/wow.coffee index fa9ecea..da1c957 100644 --- a/src/wow.coffee +++ b/src/wow.coffee @@ -275,8 +275,8 @@ class @WOW offset = box.getAttribute('data-wow-offset') or @config.offset viewTop = window.pageYOffset viewBottom = viewTop + Math.min(@element.clientHeight, @util().innerHeight()) - offset - top = @offsetTop(box) - bottom = top + box.clientHeight + top = box.getBoundingClientRect().top + bottom = box.getBoundingClientRect().bottom top <= viewBottom and bottom >= viewTop