osrec / SuperSlide.js

A flexible, smooth, GPU accelerated sliding menu for your next PWA
https://osrec.co.uk/products/superslidejs
GNU General Public License v3.0
490 stars 21 forks source link

Add onDrag function which returns percent completion; Close #2 #4

Open JacobDB opened 6 years ago

JacobDB commented 6 years ago

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).

osrec commented 6 years ago

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

JacobDB commented 6 years ago

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

JacobDB commented 6 years ago

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

JacobDB commented 6 years ago

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

JacobDB commented 5 years ago

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

osrec commented 5 years ago

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

JacobDB commented 5 years ago

Great, thanks much!

JacobDB commented 5 years ago

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