File tree 1 file changed +4
-16
lines changed
static/usage/v7/animations/before-and-after-hooks
1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change 3
3
<ion-card-content >Card</ion-card-content >
4
4
</ion-card >
5
5
6
- <ion-button id = " play" >Play</ion-button >
7
- <ion-button id = " pause" >Pause</ion-button >
8
- <ion-button id = " stop" >Stop</ion-button >
6
+ <ion-button onclick = " animation. play() " >Play</ion-button >
7
+ <ion-button onclick = " animation. pause() " >Pause</ion-button >
8
+ <ion-button onclick = " animation. stop() " >Stop</ion-button >
9
9
10
10
<script >
11
- const card = createAnimation ()
11
+ var animation = createAnimation ()
12
12
.addElement (document .querySelector (' #card' ))
13
13
.duration (2000 )
14
14
.beforeStyles ({
24
24
{ offset: 0.5 , transform: ' scale(1.5)' },
25
25
{ offset: 1 , transform: ' scale(1)' },
26
26
]);
27
-
28
- document .querySelector (' #play' ).addEventListener (' click' , async () => {
29
- await card .play ();
30
- });
31
-
32
- document .querySelector (' #pause' ).addEventListener (' click' , async () => {
33
- await card .pause ();
34
- });
35
-
36
- document .querySelector (' #stop' ).addEventListener (' click' , async () => {
37
- await card .stop ();
38
- });
39
27
</script >
40
28
```
You can’t perform that action at this time.
0 commit comments