If you want to add snap-to functionality to your web page, check out this ridiculously easy-to-use JavaScript library.

Just add it (and jQuery) to your page, then define which HTML elements you want to make the snap points. I love simple-to-use code, don’t you?

I’ll add onto it later as new ideas pop into my head. Right now, it’s using a timeout to account for the fact that there’s no scroll-end event in the DOM or jQuery. I’m not a huge fan of timeouts, but in this case it seems to work. I’d like something more elegant going forward.

Get the Code on GitHub

Continue reading