Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
Updated information on loading animations pragmatically.
  • Loading branch information
samuelOsborne authored Mar 4, 2022
1 parent fbc6f3f commit 168317d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ You may set and load animations programatically as well.

```js
const player = document.querySelector("lottie-player");
player.load("https://assets3.lottiefiles.com/packages/lf20_UJNc2t.json");

// or load via a Bodymovin JSON string/object
player.load(
'{"v":"5.3.4","fr":30,"ip":0,"op":38,"w":315,"h":600,"nm":"new", ... }'
);
player.addEventListener("rendered", (e) => {
//Load via URL
player.load("https://assets3.lottiefiles.com/packages/lf20_UJNc2t.json");
// or load via a Bodymovin JSON string/object
player.load(
'{"v":"5.3.4","fr":30,"ip":0,"op":38,"w":315,"h":600,"nm":"new", ... }'
);
});
```

### TGS-Player
Expand Down

0 comments on commit 168317d

Please sign in to comment.