briangonzalez / jquery.pep.js

👟 Pep, a lightweight plugin for kinetic drag on mobile/desktop
http://pep.briangonzalez.org
1.3k stars 178 forks source link

Possible to manually invoke a pep event (simulate dragging)? #204

Closed ScottBeeson closed 7 years ago

ScottBeeson commented 7 years ago

Is there any way to simulate a drag event like pep.drag('left',100)?

seanCodes commented 7 years ago

Sorry to say nothing like this exists in the library currently. Not sure how you would do it natively, either. It seems implementing a feature like this would be pretty complex, since all click/drag events would need to be simulated as well as simply moving the pep object. (Unless you're just interested in repositioning the object with a smooth transition? Something like that would be doable.)

If you can describe what it is you're trying to accomplish I'd be happy to help work it out

ScottBeeson commented 7 years ago

Well I have a menu that I can drag in and out. When I do that, it does some other fairly complex things like resizing the items in the menu, etc. I wanted to make a toggle that would open and close the menu with one touch, but then I have to manually do all the other stuff. I was just thinking it might be cool if I could have pep do all the work.

it was just a dream though :)