You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 17, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: docs/ui/animation-css.md
+46-42Lines changed: 46 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -262,48 +262,9 @@ __Example 13: How to trigger animation on element special state__
262
262
263
263
> As of version 2.0, only the **Button** component has a built-in special state "highlighted" to indicate that it is touched by the user.
264
264
265
-
## Access CSS animations from code
266
-
267
-
The simplest way to trigger a CSS animation is by changing the element **className** property:
268
-
269
-
__Example 14: How to trigger CSS animation__
270
-
271
-
```JavaScript
272
-
var view =page.getViewById("view");
273
-
view.className="transparent";
274
-
```
275
-
```TypeScript
276
-
let view =page.getViewById<viewModule.View>("view");
277
-
view.className="transparent";
278
-
```
279
-
280
-
All keyframes defined in CSS can be accessed with code by using the **getKeyframeAnimationWithName** method. This allows further customization of animation properties:
265
+
## Animations - width and height
281
266
282
-
__Example 15: Accessing CSS defined keyframe in the code via **getKeyframeAnimationWithName** method__
283
-
284
-
```JavaScript
285
-
var keyframeAnimation =require("tns-core-modules/ui/animation/keyframe-animation");
286
-
287
-
var view =page.getViewById("view");
288
-
var animationInfo =page.getKeyframeAnimationWithName("bounce");
289
-
animationInfo.duration=2000;
290
-
var animation =keyframeAnimation.KeyframeAnimation.keyframeAnimationFromInfo(animationInfo);
The simplest way to trigger a CSS animation is by changing the element **className** property:
344
+
345
+
__Example 15: How to trigger CSS animation__
346
+
347
+
```JavaScript
348
+
var view =page.getViewById("view");
349
+
view.className="transparent";
350
+
```
351
+
```TypeScript
352
+
let view =page.getViewById<viewModule.View>("view");
353
+
view.className="transparent";
354
+
```
355
+
356
+
All keyframes defined in CSS can be accessed with code by using the **getKeyframeAnimationWithName** method. This allows further customization of animation properties:
357
+
358
+
359
+
__Example 16: Accessing CSS defined keyframe in the code via **getKeyframeAnimationWithName** method__
360
+
361
+
```JavaScript
362
+
var keyframeAnimation =require("tns-core-modules/ui/animation/keyframe-animation");
363
+
364
+
var view =page.getViewById("view");
365
+
var animationInfo =page.getKeyframeAnimationWithName("bounce");
366
+
animationInfo.duration=2000;
367
+
var animation =keyframeAnimation.KeyframeAnimation.keyframeAnimationFromInfo(animationInfo);
0 commit comments