0.1.1-beta • Published 6 years ago
pointer.js v0.1.1-beta
pointer.js
A waypoint library to find your place in the DOM. Pointer.js is built on the experimental Intersection Observer API to determine if an element is visible in the viewport. Pointer.js is ready to use across all browsers and all devices.
Installation
Source | |
---|---|
npm | npm install pointer.js --save |
yarn | yarn add pointer.js |
unpkg | https://unpkg.com/pointer.js |
Usage
var waypoint = new Pointer({
element: document.querySelector('.js-waypoint'),
handler: function (entry) {
alert('The element is in view!')
}
})
API
new Pointer(options)
options: A Javascript object containing Pointer options. This object is required. It must contain element and handler properties.
options.element: A document element that you wish to set as the waypoint.
options.handler: A function that executes when the options.element is in view. The function passes an Intersection Observer Entry.
Copyright & Licensing
Copyright 2018 Anthony Gonzales. Code released under the MIT License.
0.1.1-beta
6 years ago
0.1.0-beta
6 years ago
0.0.3-beta
6 years ago
0.0.2-beta
6 years ago
0.0.1-beta
6 years ago
1.0.0
6 years ago