Event Delegation without jQuery

JSfiddle logo

Today we’re going to listen to some buttons from a parent element, and we’re not going to use jQuery. We’re going to use vanilla JavaScript. I still love me some jQuery, of course, but we don’t gain a deeper understanding of JavaScript unless we dig into it a little bit and let go of our favorite tools.

Managing JavaScript on Resize

JSfiddle logo

For the past good long while, I’ve been using a throttled function to do various JavaScript chores when the browser fires a resize event. It’s a good way to correct the heights of things or add a class when the window hits a certain size. That’s been fine for a while, but recently I found a need to upgrade things.