samccone / scrollin Goto Github PK
View Code? Open in Web Editor NEW:scroll: A leak free performance focused scroll util
License: MIT License
:scroll: A leak free performance focused scroll util
License: MIT License
The current version has an issue with browserify
Cannot find module 'lodash.debounce'
which is odd.
Going to unit test this tool vs an boring integration suite.. To make this possible the following methods need to be stubbed and the following internal APIs need to be exposed
Methods
requestAnimationFrame
addEventListener
Props
Methods
getBoundingClientRect
{right: xx, left: xx, top: xx}
tracking
Create an option to simply pass an offset in order to have it fire later into the viewport.
This line removes the _onScroll method:
https://github.com/samccone/scrollin/blob/master/index.js#L41
This line adds a throttled _onScroll method:
https://github.com/samccone/scrollin/blob/master/index.js#L49
Will the _onScroll handler never die since the function registered isn't the function deregistered?
This would be a nicer API compared to
Array.prototype.slice.call(document.querySelectorAll('.foo'))
.forEach(n => Scrollin.track(n, myFunc))
Sometimes you need a fake scroll container instead of window, for things like basement menus or certain page transitions. This requires tracking an element's scroll events, rather than window.
Thankfully, the project I'm working on has down away with its scrolljacked container. But I thought I'd raise this for down the road.
Normally, I'd use my own morlock.js for this, but I'm tired of maintaining it so I put this TODO on your plate instead :)
The important parts are: https://github.com/tdreyno/morlock.js/blob/master/streams/scroll-stream.js#L15
And: https://github.com/tdreyno/morlock.js/blob/master/core/dom.js#L42-L52
Thanks for this simple project ๐ป
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.