SuperSlide.js
SuperSlide.js copied to clipboard
Add onDrag function which returns percent completion; Close #2
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).
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
Sure thing, I've moved that in to a variable.
Actually, I think it might've messed up the slideRight transition, investigating...
Fixed, I was calling me.p.sliderOffsetWidth instead of me.p.slider.offsetWidth for slideRight.
@osrec have you had a chance to take a look at this? Would love it to get merged in to master.
Hello, sorry for the delay. Very busy in the office. Promise to get this merged in the next couple of days!
Great, thanks much!
Any status update on this? Would love to start using this script more regularly