SuperSlide.js icon indicating copy to clipboard operation
SuperSlide.js copied to clipboard

Add onDrag function which returns percent completion; Close #2

Open JacobDB opened this issue 7 years ago • 8 comments
trafficstars

Added a simple function that returns the percent completion so that developers can do things relative to the total completion (such as fading in an overlay as the user drags).

JacobDB avatar Sep 14 '18 20:09 JacobDB

Hi Jacob,

Thanks for this :)

Could you put offsetWidth into a variable so that we are not triggering layout/reflow each time on line 119 and 124 here: https://github.com/osrec/SuperSlide.js/pull/4/commits/e0e88dcec1b986106dea8a390a85d0ae9994e83a#diff-ce41a7853f6663e487226c470a1d7f0aR119

Probably worth defining it before getting into the touchmove function, as it's not really going to change after the touchstart event.

Thanks very much! OSREC Dev Team

osrec avatar Sep 15 '18 14:09 osrec

Sure thing, I've moved that in to a variable.

JacobDB avatar Sep 15 '18 16:09 JacobDB

Actually, I think it might've messed up the slideRight transition, investigating...

JacobDB avatar Sep 15 '18 16:09 JacobDB

Fixed, I was calling me.p.sliderOffsetWidth instead of me.p.slider.offsetWidth for slideRight.

JacobDB avatar Sep 15 '18 16:09 JacobDB

@osrec have you had a chance to take a look at this? Would love it to get merged in to master.

JacobDB avatar Oct 31 '18 18:10 JacobDB

Hello, sorry for the delay. Very busy in the office. Promise to get this merged in the next couple of days!

osrec avatar Nov 01 '18 13:11 osrec

Great, thanks much!

JacobDB avatar Nov 01 '18 16:11 JacobDB

Any status update on this? Would love to start using this script more regularly

JacobDB avatar Jan 13 '19 14:01 JacobDB