jQuery Each

Don’t forget that $(each) and $.each() do two different things in jQuery. I’ve spent ages before banging my head because a piece of code wasn’t working as expected, and it ended up being because I wrote the wrong version of $.each. $(‘selector’).each(…) will iterate over the selected elements, while $.each(variable, …) will iterate over the […]

Writing a loop for CSS using LESS

Note: I use the PHP compiler for LESS, so the available options/syntax isn’t completely the same as the regular version. Writing a loop using LESS is actually really easy. All you need is a guarded mixin. For example, I use loops when I have a list of icons that all differ but it’s too much […]