javascript - 大家一起看看这段js代码,有引用skrollr.js,到底做了哪些事情?

查看:91
本文介绍了javascript - 大家一起看看这段js代码,有引用skrollr.js,到底做了哪些事情?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题


一段代码

js
skrollr.js

解决方案

你去查上下文 data.curTop 和 data.lastTop 的取值

然后官方文档里有描述

A listener function that gets called each time right before we render everything. The function will be passed an object with the following properties:

{
    curTop: 10, //the current scroll top offset
    lastTop: 0, //the top value of last time
    maxTop: 100, //the max value you can scroll to. curTop/maxTop will give you the current progress.
    direction: 'down' //either up or down
}

Returning false will prevent rendering.

当返回 false 停止渲染

这篇关于javascript - 大家一起看看这段js代码,有引用skrollr.js,到底做了哪些事情?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆