Skip to content

Commit 168317d

Browse files
Updated README
Updated information on loading animations pragmatically.
1 parent fbc6f3f commit 168317d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ You may set and load animations programatically as well.
8888

8989
```js
9090
const player = document.querySelector("lottie-player");
91-
player.load("https://assets3.lottiefiles.com/packages/lf20_UJNc2t.json");
92-
93-
// or load via a Bodymovin JSON string/object
94-
player.load(
95-
'{"v":"5.3.4","fr":30,"ip":0,"op":38,"w":315,"h":600,"nm":"new", ... }'
96-
);
91+
player.addEventListener("rendered", (e) => {
92+
//Load via URL
93+
player.load("https://assets3.lottiefiles.com/packages/lf20_UJNc2t.json");
94+
// or load via a Bodymovin JSON string/object
95+
player.load(
96+
'{"v":"5.3.4","fr":30,"ip":0,"op":38,"w":315,"h":600,"nm":"new", ... }'
97+
);
98+
});
9799
```
98100

99101
### TGS-Player

0 commit comments

Comments
 (0)