Skip to content

Update Basic Animations section #1687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/pages/utilities/animations.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,15 @@ this.animationCtrl.create()
.duration(1500)
.iterations(Infinity)
.fromTo('transform', 'translateX(0px)', 'translateX(100px)')
.fromTo('opacity', '1', '0.2');
.fromTo('opacity', '1', '0.2')
.play();
```
</docs-tab>
<docs-tab tab="react">

```typescript
<CreateAnimation
play={true}
duration={1500}
iterations={Infinity}
fromTo={[
Expand All @@ -139,6 +141,8 @@ this.animationCtrl.create()
</docs-tab>
</docs-tabs>

You can view a live example of this in Angular [here](https://stackblitz.com/edit/ionic-angular-basic-animations) and in React [here](https://stackblitz.com/edit/ionic-react-basic-animations).

In the example above, an animation that changes the opacity on the `.square` element and moves it from left to right along the X axis has been created. This animation will run an infinite number of times, and each iteration of the animation will last 1500ms.

By default, all Ionic Animations are paused until the `play` method is called.
Expand Down