ScrollTrigger+gsap实现浏览器滚动控制动画效果代码

代码语言:html

所属分类:加载滚动

代码描述:ScrollTrigger+gsap实现浏览器滚动控制动画效果代码

代码标签: 滚动 控制 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="UTF-8">


    <style>
        section {
            width: 100vw;
            height: 100vh;
            overflow: hidden;
        }
        section:nth-of-type(2) {
            background: #eee;
        }

        span {
            position: absolute;
            display: block;
            text-align: center;
            font-size: 50px;
            z-index: 2;
            width: 50%;
            text-transform: uppercase;
            font-weight: 900;
            color: white;
            top: calc(50vh - 56px);
        }
        span.up {
            right: 0;
        }
        span.down {
            left: 0;
        }

        .box {
            height: 1.2vh;
            width: 50vw;
            margin-bottom: -0.2vh;
            background: teal;
            display: block;
        }
    </style>


</head>

<body>
    <section class="trigger">
        <span class="down">Scroll<br />Down</span>
        <span class="up">Scroll<br />Up</span>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class="box"></div>
        <div class=&quo.........完整代码请登录后点击上方下载按钮下载查看

网友评论0