Skip to content

Commit

Permalink
Add examples for animate()
Browse files Browse the repository at this point in the history
  • Loading branch information
leonyu committed Oct 11, 2024
1 parent 2848af9 commit b5eac6b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/comparisons/effects/animate/jquery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$(el).css({ width: '0%', 'height': '24px' })
.animate({ width: "90%" }, 1000)
.animate({ height: "400px" }, 1000);
8 changes: 8 additions & 0 deletions src/comparisons/effects/animate/modern.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
await el.animate(
[{ 'width': '0%' }, { 'width': '90%' }],
{ duration: 1000, fill: 'forwards' }
).finished;
await el.animate(
[{ 'height': '24px' }, { 'height': '400px' }],
{ duration: 1000, fill: 'forwards' }
).finished;

0 comments on commit b5eac6b

Please sign in to comment.