fx:swipe.js creates some great sliding special effects.
I reversed the logic of the swipeTo function using the
same code structure. This took quite a bit of trial and
error mixed in with attempted rational thinking.
The function is swipeOff, and it uses a private function
_swipeBack to "turn off the swipe"
ie.)
menu.swipeTo("bottom",10); //turns on the menu
menu.swipeOff(); //turns off the menu using the reverse
of what "bottom" does.
You can customize the direction and speed of the
swipeOff, or by default it will use the same speed
and "opposite" direction that swipeTo created.
bug:
There is a trade off between using repeated calls to the
swipeOff (and swipeTo for that matter). I created a fix
for it, which is commented in swipeOff, but it then
caused some problems when I used the drag features.
Therefore with this "if" statement turned off(line 171),
repeated calls "may" change the position of the element
for repeated calls (3 per second or so), but this is VERY
rare, and few programmers would need to allow
repeated calls the way I originally tested. It happens
because of the shared values between swipeTo and
swipeOff, which is obviously quite necessary.
Ryan Mills
fx swipeOff