Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用GSAP的页面转换是';t工作(从开始到结束)_Javascript_Html_Gsap - Fatal编程技术网

Javascript 使用GSAP的页面转换是';t工作(从开始到结束)

Javascript 使用GSAP的页面转换是';t工作(从开始到结束),javascript,html,gsap,Javascript,Html,Gsap,我正在使用GSAP和Highway来获得一些页面转换。我唯一的问题是,这种转变不起作用从到也被划掉 此代码基于YT视频:“使用Javascript平滑页面转换教程”-Dev Ed 有人能帮我吗 关于.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport&q

我正在使用GSAP和Highway来获得一些页面转换。我唯一的问题是,这种转变不起作用<代码>从到也被划掉

此代码基于YT视频:“使用Javascript平滑页面转换教程”-Dev Ed

有人能帮我吗

关于.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>About</title>
    <script src="./js/index.js"></script>
    <link rel="stylesheet" href="./styles/style.scss">
</head>
<body>

    <main data-router-wrapper>
        <section data-router-view="about" class="about">
            <div class="about-content">
                <div class="about-presentation">
                    <h1>About Page</h1>
                    <p>Learn more about page transitions</p>
                </div>
                <img src="./images/about.svg" alt="about">
            </div>
        </section>
    </main>

</body>
</html>
index.js

import Highway from '@dogstudio/highway';
import Fade from './transition';

const H = new Highway.Core({
    transitions: {
        default: Fade
    }
});

两件事:我们GreenSock强烈推荐,如果您想帮助调试,您应该使用以下内容创建一个。
import Highway from '@dogstudio/highway';
import Fade from './transition';

const H = new Highway.Core({
    transitions: {
        default: Fade
    }
});