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

You all remember parts of speech, right? Nouns, verbs, adjectives, pronouns, and so on from elementary school, right?

Well, some of you do.

javascript-iconThis came up during a discussion of object-based programming with JavaScript. I was searching for a way to best describe how the various parts of JavaScript can work together in a structured, maintainable manner. Rather than trying to explain MVC to junior devs, I came upon the idea of using parts of speech. In particular: Verbs, Nouns, and Adjectives.

Continue reading