Itsy Bitsy Bytes


Code and stuff
on javascript

Changing the language for the Bootstrap Date Paginator plugin

At least once in every developer's life comes a moment when he must struggle with someone else's plugin. It does everything you need with close to no effort on your side, except for one tiny but very important thing. Sometimes, it's enough to simply read the manual but more often
Read More
on javascript

JSRatio - preserving your aspect ratios

I was trying to do something fun for myself when I ran into the old aspect ratio problem. I wanted a div with a percentage-based width and a height that will update automatically while preserving a certain ratio. Doing it for an image is really simple, for everything else not
Read More
on javascript

Javascript's scoping got me

When programming, I often use a pattern like this one: var myDefaultVariable; for (var key in object) { myDefaultVariable = myDefaultVariable || getOtherVariable(); // do stuff } The code above is not an exact form and it's something I use mostly when I have an original value that needs to be determined only for first
Read More
on javascript, css

When animationEnd is not fired

I ran into a problem today with an animated action. It was part of a queue and the next command was triggered from inside the animationEnd callback. The animations I was using were made with CSS classes and detecting the animation completion with Javascript was a much more elegant and
Read More