Capítulo 151 de 411
CustomBounce is a paid GSAP plugin that generates a configurable bounce ease (and an optional synced squash/stretch ease) built on top of CustomEase, instead of using the fixed built-in "bounce" ease.
id; requires CustomEase to be registered first.0.7.0 (no squash).<id>-squash.true, the ease returns to its starting value at the end (useful for leap-and-land effects)."bounce(0.5)" or "bounce({strength:0.5, endAtStart:true})" can be used inline without a separate create() call.gsap.registerPlugin(CustomEase, CustomBounce);
CustomBounce.create("myBounce", { strength: 0.6, squash: 3, squashID: "myBounce-squash" });
gsap.from(".class", { duration: 2, y: -200, ease: "myBounce" });
gsap.to(".class", {
duration: 2, scaleX: 1.4, scaleY: 0.6,
ease: "myBounce-squash", transformOrigin: "center bottom",
});
CustomBounce.create() call.| Option | Type | Default | Notes |
|---|---|---|---|
| strength | Number | 0.7 | higher = more bounces |
| endAtStart | Boolean | false | return to start value at the end |
| squash | Number | 0 | duration of squash phase between bounces |
| squashID | String | <id>-squash | id of the generated squash ease |
getSVGData() (inherited from CustomEase) can render any CustomBounce ease as an SVG path for visualization.getSVGData() method.