Javascript 如何修复未捕获的引用错误:未定义TimelineMax

Javascript 如何修复未捕获的引用错误:未定义TimelineMax,javascript,html,jquery,css,Javascript,Html,Jquery,Css,我的JS文件: const logo = document.querySelector("#logo"); const tl = new TimelineMax({}); tl.fromTo(logo, 1, {height: "0%"}, {height: "80%"}); #logo{ width: 100%; height: 100%; position: absolute; top: 200px; z-index: -1; }

我的JS文件:

const logo = document.querySelector("#logo");
const tl = new TimelineMax({});
tl.fromTo(logo, 1, {height: "0%"}, {height: "80%"});
#logo{
width: 100%;
height: 100%;
position: absolute;
top: 200px;
z-index: -1;
}
<!DOCTYPE html>
<html lang= "es">
    <head>
        <title>Quark</title>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="Style.css">
    </head>
    <body>
        <div class="Limg">
            <img id="logo" src= "Logo.svg">
        </div>
        <script src="animaciones.js"></script> 
        <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js" integrity="sha512-DkPsH9LzNzZaZjCszwKrooKwgjArJDiEjA5tTgr3YX4E6TYv93ICS8T41yFHJnnSmGpnf0Mvb5NhScYbwvhn2w==" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TimelineMax.min.js" integrity="sha512-0xrMWUXzEAc+VY7k48pWd5YT6ig03p4KARKxs4Bqxb9atrcn2fV41fWs+YXTKb8lD2sbPAmZMjKENiyzM/Gagw==" crossorigin="anonymous"></script>
    </body>
</html>
我的CSS文件:

const logo = document.querySelector("#logo");
const tl = new TimelineMax({});
tl.fromTo(logo, 1, {height: "0%"}, {height: "80%"});
#logo{
width: 100%;
height: 100%;
position: absolute;
top: 200px;
z-index: -1;
}
<!DOCTYPE html>
<html lang= "es">
    <head>
        <title>Quark</title>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="Style.css">
    </head>
    <body>
        <div class="Limg">
            <img id="logo" src= "Logo.svg">
        </div>
        <script src="animaciones.js"></script> 
        <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js" integrity="sha512-DkPsH9LzNzZaZjCszwKrooKwgjArJDiEjA5tTgr3YX4E6TYv93ICS8T41yFHJnnSmGpnf0Mvb5NhScYbwvhn2w==" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TimelineMax.min.js" integrity="sha512-0xrMWUXzEAc+VY7k48pWd5YT6ig03p4KARKxs4Bqxb9atrcn2fV41fWs+YXTKb8lD2sbPAmZMjKENiyzM/Gagw==" crossorigin="anonymous"></script>
    </body>
</html>
我的HTML文件:

const logo = document.querySelector("#logo");
const tl = new TimelineMax({});
tl.fromTo(logo, 1, {height: "0%"}, {height: "80%"});
#logo{
width: 100%;
height: 100%;
position: absolute;
top: 200px;
z-index: -1;
}
<!DOCTYPE html>
<html lang= "es">
    <head>
        <title>Quark</title>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="Style.css">
    </head>
    <body>
        <div class="Limg">
            <img id="logo" src= "Logo.svg">
        </div>
        <script src="animaciones.js"></script> 
        <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js" integrity="sha512-DkPsH9LzNzZaZjCszwKrooKwgjArJDiEjA5tTgr3YX4E6TYv93ICS8T41yFHJnnSmGpnf0Mvb5NhScYbwvhn2w==" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TimelineMax.min.js" integrity="sha512-0xrMWUXzEAc+VY7k48pWd5YT6ig03p4KARKxs4Bqxb9atrcn2fV41fWs+YXTKb8lD2sbPAmZMjKENiyzM/Gagw==" crossorigin="anonymous"></script>
    </body>
</html>

夸克

我不知道问题出在哪里,已经在尝试使用不同的版本,并且没有任何东西移动您的脚本标记,以便在标题上显示timeline max

<head>
    <title>Quark</title>
    <meta charset="UTF-8" />
    <link rel="stylesheet" href="Style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js" integrity="sha512-DkPsH9LzNzZaZjCszwKrooKwgjArJDiEjA5tTgr3YX4E6TYv93ICS8T41yFHJnnSmGpnf0Mvb5NhScYbwvhn2w==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TimelineMax.min.js" integrity="sha512-0xrMWUXzEAc+VY7k48pWd5YT6ig03p4KARKxs4Bqxb9atrcn2fV41fWs+YXTKb8lD2sbPAmZMjKENiyzM/Gagw==" crossorigin="anonymous"></script>
 </head>

夸克

在尝试调用TimelineMax之前(而不是之后)导入TimelineMax我该怎么做?这样行吗?从“gsap”导入{TweenMax,TimelineMax};不,重新安排您的脚本标记。我先放了TimeLineMax脚本,然后放了另一个?它成功了,非常感谢Ryan和所有帮助我的人:))