Skip to content

Commit 312a2ca

Browse files
shufangyiPanJiaChen
shufangyi
authored andcommitted
fixBug[waves.js]: wave's position (#949)
* fixBug[waves.js]-wave's position * fix[waves.js]-wave's position
1 parent f3733c0 commit 312a2ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/directive/waves/waves.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export default{
2929
ripple.style.left = (rect.width / 2 - ripple.offsetWidth / 2) + 'px'
3030
break
3131
default:
32-
ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.body.scrollTop) + 'px'
33-
ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.body.scrollLeft) + 'px'
32+
ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop || document.body.scrollTop) + 'px'
33+
ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft || document.body.scrollLeft) + 'px'
3434
}
3535
ripple.style.backgroundColor = opts.color
3636
ripple.className = 'waves-ripple z-active'

0 commit comments

Comments
 (0)