Capítulo 138 de 411
mapRange() maps a number's relative position within one range to the equivalent position in another range (like a ratio conversion) — e.g. a 0-200px slider driving movement across a 0-window-width stage.
| Signature | Description |
|---|---|
mapRange(inMin, inMax, outMin, outMax, valueToMap) | returns the mapped number immediately |
mapRange(inMin, inMax, outMin, outMax) | returns a reusable mapping function |
gsap.utils.mapRange(-10, 10, 100, 200, 0); // 150