HazemAM / Ripples

A simple, standalone, customizable Material Design surface reaction implementation.
https://hazemam.github.io/Ripples/demo/
Apache License 2.0
3 stars 0 forks source link

Ripple not aligned correctly when scrolled down #1

Open talaing opened 3 years ago

talaing commented 3 years ago

When I scroll down, ripple will not be aligned correctly https://gyazo.com/75a46077804bbe120a22228e9edfa8a4

talaing commented 3 years ago

I solved this issue myself. If anyone else is struggling, here's the code. Replace this from line 52 to 57

Ripples.mouseDownListen = function(e){
    var rect = this.getBoundingClientRect(),
        x = e.pageX - rect.left - window.scrollX,
        y = e.pageY - rect.top - window.scrollY;
    Ripples.down(this, e, x, y, rect.width, rect.height);
};
HazemAM commented 3 years ago

Thanks @talaing for the report!

I'm actually going to leave this issue open, since the fix needs to be released.