Q:

javascript bind an event to a change of classname

Is it possible in javascript / jQuery to bind a function to a DOM element's classname changing or being assigned a new class? 

A:

No, there's no broadly-supported event fired when the class is updated.  You'll have to poll.  Some browsers support DOM mutation events, but it's never been completely supported cross-browser, see the warning on the linked page. 
Obviously, if it's your code that changes the class, you could create a function you use to do that and always use that function rather than changing it directly, but if you're looking for changes to it outside of your code, I don't see an alternative to polling. 
If you poll, be sure to test on all of your target browsers and do as little work actually in the polling code as you can.  It's easy to over-do it (slowing down the page).