waypoints README

The project's README from github.com/imakewebthings/waypoints. As one markdown file: README.md.

Waypoints

Waypoints is a library that makes it easy to execute a function whenever you scroll to an element. Build Status

var waypoint = new Waypoint({
  element: document.getElementById('thing'),
  handler: function(direction) {
    alert('You have scrolled to a thing')
  }
})

If you're new to Waypoints, check out the Getting Started guide.

Read the full documentation for more details on usage and customization.

Shortcuts

In addition to the normal Waypoints script, extensions exist to make common UI patterns just a little easier to implement:

Contributing

If you want to report a Waypoints bug or contribute code to the library, please read the Contributing Guidelines. If you need help using Waypoints, please do not open an issue. Instead, ask the question on Stack Overflow and tag it with #jquery-waypoints. Be sure to follow the guidelines for asking a good question.

License

Copyright (c) 2011-2014 Caleb Troughton. Licensed under the MIT license.

waypoints (imakewebthings/waypoints)

Searching Database…

10.3K ·GitHub
这是什么?Waypoints 是一个 JavaScript 库,让用户滚动到页面元素时触发某个函数变得很简单——这是页面上滚动驱动行为的基本触发方式。
它是网页用的前端库,还是别的东西?它是一个在浏览器中运行的前端库:你把 waypoint 绑定到页面元素上,当用户滚动到这些元素时它就会执行回调。它不是框架——只是一个脚本加上一些可选的快捷扩展。
我该怎么开始使用它?按照 README 顶部链接的入门指南操作,然后查阅完整文档了解用法和自定义的细节。
使用它需要 jQuery 或其他库吗?这个库本身没有声明任何运行时依赖。它在 Stack Overflow 上的支持标签是 #jquery-waypoints,这是它早期作为 jQuery 插件的遗留痕迹,所以一些老教程可能会默认你在用 jQuery。
它会帮我实现功能,还是只提醒我该动手了?核心功能只在滚动到指定位置时触发你的函数——之后做什么(加载更多内容、切换吸顶导航)都由你自己的代码决定。快捷扩展则把最常见的模式预先打包好了。
它是免费的吗?可以用于商业项目吗?是的——它采用 MIT 许可证,个人和商业使用都没问题。
它开箱就支持无限滚动或吸顶元素这类常见模式吗?支持——快捷扩展正好提供这些:无限滚动(Infinite Scrolling)、吸顶元素(Sticky Elements)和进入视口检测(Inview Detection),它们都构建在核心的 waypoint 脚本之上。
Size
1.3 MB
Stars
10.3K
Updated
CommitSep 03
Age
15y
Commits · 90 Days