jQuery Waypoints
02 March 2011
Last week I pushed a little jQuery plugin to GitHub called jQuery Waypoints that gives developers an easy hook into firing a function when users scroll to any given element. Thanks to some love from the Forrst community and a brief stint in the Top 10 on Hacker News, it’s gained the attention of a few eyes. I’m just glad that somebody found it useful. Now that I’ve had a chance to process the immediate feedback and fix a bug or two, I’d like to look back on what I learned.
History
Waypoints started as a scrappy MooTools class that I wrote for a friend to use in one of his projects. The code, aside from being a little gross, had the sole purpose of snapping the user’s scroll position to the top of a section when the user scrolled close enough to it. I still don’t feel comfortable interrupting a user’s natural scroll to force them to a different one, but the concept of using scroll proximity stuck with me.
Prior Art
Remy Sharp’s inview plugin is another great way to tie user scrolling to events, but only concerns itself with two element positions: entering and leaving the viewport. If those are the only element positions you want to deal with, I still think inview is a superior plugin.
GitHub = Pleasure
This was my first real open source public project. A lot of my career agency work has been for large clients that I probably can’t even name under NDA. And my one other public repository is a MooTools port of somebody else’s original work.
Git Immersion is a great resource for anyone looking to get started using Git seriously. Anyone who has ever taken the dive will tell you: there’s no going back. Once you’re comfortable with moving between branches, committing, and pushing, GitHub Pages are cake and a natural place for project pages to live.
Documentation = Important
Considering I was 8800 miles away, I didn’t actually see it, but Kyle Neath’s Documentation is freaking awesome deck really kicked me into giving a much better project documentation experience than I might have otherwise. I probably spent as much time tweaking the wording and appearance of the docs as I did writing the plugin. Not only does it reduce friction for the developer trying to use Waypoints, it reduces friction for me in trying to answer questions and support it.
The Future
With the most recent release, I’ve finished adding core functionality. Writing unit tests, fixing bugs as they come in, and expanding the platforms the plugin covers will be the main focus in the near future. Waypoints does what it does well enough and I’d prefer to keep it light. I’ll be interested to see if anyone uses it as a brick to build something neat. If you use Waypoints and would like to share with me how you’re using it, give me a shout.