fixed to work with jquery 1.8.+

replaced jquery.data(target, 'events') with $._data(target, 'events')