Capítulo 149 de 411
wrapYoyo() is like wrap(), but instead of cycling straight back to the start when the range is exceeded, it bounces back and forth (yoyo).
| Signature | Description |
|---|---|
wrapYoyo(min, max, value) | wrapYoyo(array, index) | returns the wrapped value immediately |
wrapYoyo(min, max) | wrapYoyo(array) | returns a reusable function |
gsap.utils.wrapYoyo(["red", "green", "yellow"], 5); // "red" (index 5 -> 0 via yoyo)