From b5eac6b584096b47208a235915493c0ab1507192 Mon Sep 17 00:00:00 2001 From: Leon Yu Date: Thu, 10 Oct 2024 22:33:28 -0400 Subject: [PATCH] Add examples for animate() --- src/comparisons/effects/animate/jquery.js | 3 +++ src/comparisons/effects/animate/modern.js | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 src/comparisons/effects/animate/jquery.js create mode 100644 src/comparisons/effects/animate/modern.js diff --git a/src/comparisons/effects/animate/jquery.js b/src/comparisons/effects/animate/jquery.js new file mode 100644 index 0000000..de8b2e6 --- /dev/null +++ b/src/comparisons/effects/animate/jquery.js @@ -0,0 +1,3 @@ +$(el).css({ width: '0%', 'height': '24px' }) + .animate({ width: "90%" }, 1000) + .animate({ height: "400px" }, 1000); diff --git a/src/comparisons/effects/animate/modern.js b/src/comparisons/effects/animate/modern.js new file mode 100644 index 0000000..2aea443 --- /dev/null +++ b/src/comparisons/effects/animate/modern.js @@ -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;