Well, this is not actually an issue, but maybe it should be added to documentation. In my case, I had to replace .on with .bind because I have a Drupal 7 install. D7 is based on jQuery 1.4.4 (your script uses 1.7.2) and if you upgrade jQuery script version, all sorts of problems appear on D7 because of lack of compatibility of several of its scripts with the later versions of jQuery. The solution for me was to replace (on your script) the jQuery .on with .bind twice. Other from that, many, many thanks for sharing this. Did help a lot!
Well, this is not actually an issue, but maybe it should be added to documentation. In my case, I had to replace .on with .bind because I have a Drupal 7 install. D7 is based on jQuery 1.4.4 (your script uses 1.7.2) and if you upgrade jQuery script version, all sorts of problems appear on D7 because of lack of compatibility of several of its scripts with the later versions of jQuery. The solution for me was to replace (on your script) the jQuery .on with .bind twice. Other from that, many, many thanks for sharing this. Did help a lot!