From 312a2ca8ed59975e3658e5ce47c9761fa1947c34 Mon Sep 17 00:00:00 2001 From: shufangyi <102338496@qq.com> Date: Mon, 13 Aug 2018 13:45:05 +0800 Subject: [PATCH] fixBug[waves.js]: wave's position (#949) * fixBug[waves.js]-wave's position * fix[waves.js]-wave's position --- src/directive/waves/waves.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/directive/waves/waves.js b/src/directive/waves/waves.js index ac1d8611..83070113 100644 --- a/src/directive/waves/waves.js +++ b/src/directive/waves/waves.js @@ -29,8 +29,8 @@ export default{ ripple.style.left = (rect.width / 2 - ripple.offsetWidth / 2) + 'px' break default: - ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.body.scrollTop) + 'px' - ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.body.scrollLeft) + 'px' + ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop || document.body.scrollTop) + 'px' + ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft || document.body.scrollLeft) + 'px' } ripple.style.backgroundColor = opts.color ripple.className = 'waves-ripple z-active'