kylewetton / image-compare-viewer

Compare before and after images, for grading and other retouching for instance. Vanilla JS, zero dependencies.
https://image-compare-viewer.netlify.com
MIT License
554 stars 34 forks source link

Disable scroll when sliding #8

Closed LouisCuvelier closed 4 years ago

LouisCuvelier commented 4 years ago

It would be nice if we could disable scrolling when we are sliding, especially on mobile. Body Scroll Lock seems to be a nice solution.

But, to keep image-compare-viewer dependency free, we need to have access to events like onSlidingStart and onSlidingEnd that return the html element.

What do you think ?

kylewetton commented 4 years ago

This is something i have experimented with, looks like Body Scroll Lock has figured out the secret to it. I really don't want to add a dependency to ICV, so I'll dig through Body Scroll Lock and see if iI can figure out what they're doing.

LouisCuvelier commented 4 years ago

I forgot the "dependency free" in "to keep image-compare-viewer dependency free" in my first message.

Rather than integrating to the package, you can give access with the two events described above, so users can add or not Body Scroll Lock thanks to those events ?

kylewetton commented 4 years ago

This is fixed in 1.4.0