GSAP动画学习
一、安装
- npm安装
javascript
npm install gsap
引用:
javascript
import { gsap } from "gsap";
- CDN引用
html
<script src="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/gsap.min.js"></script>
引用:
html
<script>
// use a script tag or an external JS file
document.addEventListener("DOMContentLoaded", (event) => {
// gsap code here!
});
</script>
- yarn安装
javascript
yarn add gsap
引用:
javascript
import { gsap } from "gsap";