script代码


 data() {
        return {
            toShow3:false,
        };
    }

mounted() {
        window.addEventListener('scroll', this.handleScrollx, true);
    },
    methods: {
        handleScrollx() {
            const currentHeight = window.pageYOffset;
            // Container部分
            console.log(currentHeight);
            if (!this.toShow1 && currentHeight >= 780) {
                console.log('780显示');
                this.toShow1 = true;
            }
            // BehaviorWatch部分
            if (!this.toShow2 && currentHeight >= 1900) {
                console.log('1900显示');
                this.toShow2 = true;
            }
            // Advantage部分
            if (!this.toShow3 && currentHeight >= 3030) {
                console.log('3030显示');
                this.toShow3 = true;
            }
        }
        
    }

css代码

  .txt {
          // 当网页滚动到一定高度文字显现的动画效果
            @keyframes textAnimation {
                0% {
                    opacity: 0;
                }
                25% {
                    opacity: 0.5;
                }
                50% {
                    opacity: 0.8;
                }
                100% {
                    transform: translateY(-10%);
                    opacity: 1;
                }
            }

        .text1 {
            font-weight: bold;
            color: #4e4e4e;
            font-size: 48px;
            // opacity: 0;
            animation: textAnimation 2s ease-out  forwards;
        }

html代码

<div class="txt" >
            <div class="text1" v-show="toShow3">强劲带机量</div>
            <div class="text1" style="margin-bottom: 50px" v-show="toShow3">多人上网不卡顿</div>
            <div class="text2" v-show="toShow3">AX2 Pro采用OFDMA+MU-MIMO技术,实现多个用户数据同时传输,让多用户使用网</div>
            <div class="text2" v-show="toShow3">络场景下的传输速率延时更低、效率更高,满足多人同时畅快上网需求。</div>
        </div>

  

原文地址:http://www.cnblogs.com/hs20011205/p/16898891.html

1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长! 2. 分享目的仅供大家学习和交流,请务用于商业用途! 3. 如果你也有好源码或者教程,可以到用户中心发布,分享有积分奖励和额外收入! 4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解! 5. 如有链接无法下载、失效或广告,请联系管理员处理! 6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需! 7. 如遇到加密压缩包,默认解压密码为"gltf",如遇到无法解压的请联系管理员! 8. 因为资源和程序源码均为可复制品,所以不支持任何理由的退款兑现,请斟酌后支付下载 声明:如果标题没有注明"已测试"或者"测试可用"等字样的资源源码均未经过站长测试.特别注意没有标注的源码不保证任何可用性